File: instance_exec.go

package info (click to toggle)
incus 6.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 23,864 kB
  • sloc: sh: 16,015; ansic: 3,121; python: 456; makefile: 321; ruby: 51; sql: 50; lisp: 6
file content (56 lines) | stat: -rw-r--r-- 1,741 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package api

// InstanceExecControl represents a message on the instance exec "control" socket.
//
// API extension: instances.
type InstanceExecControl struct {
	Command string            `json:"command" yaml:"command"`
	Args    map[string]string `json:"args" yaml:"args"`
	Signal  int               `json:"signal" yaml:"signal"`
}

// InstanceExecPost represents an instance exec request.
//
// swagger:model
//
// API extension: instances.
type InstanceExecPost struct {
	// Command and its arguments
	// Example: ["bash"]
	Command []string `json:"command" yaml:"command"`

	// Whether to wait for all websockets to be connected before spawning the command
	// Example: true
	WaitForWS bool `json:"wait-for-websocket" yaml:"wait-for-websocket"`

	// Whether the command is to be spawned in interactive mode (singled PTY instead of 3 PIPEs)
	// Example: true
	Interactive bool `json:"interactive" yaml:"interactive"`

	// Additional environment to pass to the command
	// Example: {"FOO": "BAR"}
	Environment map[string]string `json:"environment" yaml:"environment"`

	// Terminal width in characters (for interactive)
	// Example: 80
	Width int `json:"width" yaml:"width"`

	// Terminal height in rows (for interactive)
	// Example: 24
	Height int `json:"height" yaml:"height"`

	// Whether to capture the output for later download (requires non-interactive)
	RecordOutput bool `json:"record-output" yaml:"record-output"`

	// UID of the user to spawn the command as
	// Example: 1000
	User uint32 `json:"user" yaml:"user"`

	// GID of the user to spawn the command as
	// Example: 1000
	Group uint32 `json:"group" yaml:"group"`

	// Current working directory for the command
	// Example: /home/foo/
	Cwd string `json:"cwd" yaml:"cwd"`
}