Documentation ¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, req CreateRequest) (map[string]interface{}, error)
- func (c *Client) Exec(ctx context.Context, req ExecRequest) (ExecResponse, error)
- func (c *Client) ExecStatus(ctx context.Context, req ExecStatusRequest) (ExecStatusResponse, error)
- func (c *Client) FileRead(ctx context.Context, req FileReadRequest) (FileReadResponse, error)
- func (c *Client) FileWrite(ctx context.Context, req FileWriteRequest) error
- func (c *Client) FsfreezeFreeze(ctx context.Context, req FsfreezeFreezeRequest) (map[string]interface{}, error)
- func (c *Client) FsfreezeStatus(ctx context.Context, req FsfreezeStatusRequest) (map[string]interface{}, error)
- func (c *Client) FsfreezeThaw(ctx context.Context, req FsfreezeThawRequest) (map[string]interface{}, error)
- func (c *Client) Fstrim(ctx context.Context, req FstrimRequest) (map[string]interface{}, error)
- func (c *Client) GetFsinfo(ctx context.Context, req GetFsinfoRequest) (map[string]interface{}, error)
- func (c *Client) GetHostName(ctx context.Context, req GetHostNameRequest) (map[string]interface{}, error)
- func (c *Client) GetMemoryBlockInfo(ctx context.Context, req GetMemoryBlockInfoRequest) (map[string]interface{}, error)
- func (c *Client) GetMemoryBlocks(ctx context.Context, req GetMemoryBlocksRequest) (map[string]interface{}, error)
- func (c *Client) GetOsinfo(ctx context.Context, req GetOsinfoRequest) (map[string]interface{}, error)
- func (c *Client) GetTime(ctx context.Context, req GetTimeRequest) (map[string]interface{}, error)
- func (c *Client) GetTimezone(ctx context.Context, req GetTimezoneRequest) (map[string]interface{}, error)
- func (c *Client) GetUsers(ctx context.Context, req GetUsersRequest) (map[string]interface{}, error)
- func (c *Client) GetVcpus(ctx context.Context, req GetVcpusRequest) (map[string]interface{}, error)
- func (c *Client) Index(ctx context.Context, req IndexRequest) ([]map[string]interface{}, error)
- func (c *Client) Info(ctx context.Context, req InfoRequest) (map[string]interface{}, error)
- func (c *Client) NetworkGetInterfaces(ctx context.Context, req NetworkGetInterfacesRequest) (map[string]interface{}, error)
- func (c *Client) Ping(ctx context.Context, req PingRequest) (map[string]interface{}, error)
- func (c *Client) SetUserPassword(ctx context.Context, req SetUserPasswordRequest) (map[string]interface{}, error)
- func (c *Client) Shutdown(ctx context.Context, req ShutdownRequest) (map[string]interface{}, error)
- func (c *Client) SuspendDisk(ctx context.Context, req SuspendDiskRequest) (map[string]interface{}, error)
- func (c *Client) SuspendHybrid(ctx context.Context, req SuspendHybridRequest) (map[string]interface{}, error)
- func (c *Client) SuspendRam(ctx context.Context, req SuspendRamRequest) (map[string]interface{}, error)
- type Command
- type CreateRequest
- type ExecRequest
- type ExecResponse
- type ExecStatusRequest
- type ExecStatusResponse
- type FileReadRequest
- type FileReadResponse
- type FileWriteRequest
- type FsfreezeFreezeRequest
- type FsfreezeStatusRequest
- type FsfreezeThawRequest
- type FstrimRequest
- type GetFsinfoRequest
- type GetHostNameRequest
- type GetMemoryBlockInfoRequest
- type GetMemoryBlocksRequest
- type GetOsinfoRequest
- type GetTimeRequest
- type GetTimezoneRequest
- type GetUsersRequest
- type GetVcpusRequest
- type HTTPClient
- type IndexRequest
- type InfoRequest
- type NetworkGetInterfacesRequest
- type PingRequest
- type SetUserPasswordRequest
- type ShutdownRequest
- type SuspendDiskRequest
- type SuspendHybridRequest
- type SuspendRamRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(c HTTPClient) *Client
func (*Client) Exec ¶
func (c *Client) Exec(ctx context.Context, req ExecRequest) (ExecResponse, error)
Exec Executes the given command in the vm via the guest-agent and returns an object with the pid.
func (*Client) ExecStatus ¶
func (c *Client) ExecStatus(ctx context.Context, req ExecStatusRequest) (ExecStatusResponse, error)
ExecStatus Gets the status of the given pid started by the guest-agent
func (*Client) FileRead ¶
func (c *Client) FileRead(ctx context.Context, req FileReadRequest) (FileReadResponse, error)
FileRead Reads the given file via guest agent. Is limited to 16777216 bytes.
func (*Client) FileWrite ¶
func (c *Client) FileWrite(ctx context.Context, req FileWriteRequest) error
FileWrite Writes the given file via guest agent.
func (*Client) FsfreezeFreeze ¶
func (c *Client) FsfreezeFreeze(ctx context.Context, req FsfreezeFreezeRequest) (map[string]interface{}, error)
FsfreezeFreeze Execute fsfreeze-freeze.
func (*Client) FsfreezeStatus ¶
func (c *Client) FsfreezeStatus(ctx context.Context, req FsfreezeStatusRequest) (map[string]interface{}, error)
FsfreezeStatus Execute fsfreeze-status.
func (*Client) FsfreezeThaw ¶
func (c *Client) FsfreezeThaw(ctx context.Context, req FsfreezeThawRequest) (map[string]interface{}, error)
FsfreezeThaw Execute fsfreeze-thaw.
func (*Client) GetFsinfo ¶
func (c *Client) GetFsinfo(ctx context.Context, req GetFsinfoRequest) (map[string]interface{}, error)
GetFsinfo Execute get-fsinfo.
func (*Client) GetHostName ¶
func (c *Client) GetHostName(ctx context.Context, req GetHostNameRequest) (map[string]interface{}, error)
GetHostName Execute get-host-name.
func (*Client) GetMemoryBlockInfo ¶
func (c *Client) GetMemoryBlockInfo(ctx context.Context, req GetMemoryBlockInfoRequest) (map[string]interface{}, error)
GetMemoryBlockInfo Execute get-memory-block-info.
func (*Client) GetMemoryBlocks ¶
func (c *Client) GetMemoryBlocks(ctx context.Context, req GetMemoryBlocksRequest) (map[string]interface{}, error)
GetMemoryBlocks Execute get-memory-blocks.
func (*Client) GetOsinfo ¶
func (c *Client) GetOsinfo(ctx context.Context, req GetOsinfoRequest) (map[string]interface{}, error)
GetOsinfo Execute get-osinfo.
func (*Client) GetTimezone ¶
func (c *Client) GetTimezone(ctx context.Context, req GetTimezoneRequest) (map[string]interface{}, error)
GetTimezone Execute get-timezone.
func (*Client) NetworkGetInterfaces ¶
func (c *Client) NetworkGetInterfaces(ctx context.Context, req NetworkGetInterfacesRequest) (map[string]interface{}, error)
NetworkGetInterfaces Execute network-get-interfaces.
func (*Client) SetUserPassword ¶
func (c *Client) SetUserPassword(ctx context.Context, req SetUserPasswordRequest) (map[string]interface{}, error)
SetUserPassword Sets the password for the given user to the given password
func (*Client) SuspendDisk ¶
func (c *Client) SuspendDisk(ctx context.Context, req SuspendDiskRequest) (map[string]interface{}, error)
SuspendDisk Execute suspend-disk.
func (*Client) SuspendHybrid ¶
func (c *Client) SuspendHybrid(ctx context.Context, req SuspendHybridRequest) (map[string]interface{}, error)
SuspendHybrid Execute suspend-hybrid.
func (*Client) SuspendRam ¶
func (c *Client) SuspendRam(ctx context.Context, req SuspendRamRequest) (map[string]interface{}, error)
SuspendRam Execute suspend-ram.
type Command ¶ added in v0.0.15
type Command string
const ( Command_FSFREEZE_FREEZE Command = "fsfreeze-freeze" Command_FSFREEZE_STATUS Command = "fsfreeze-status" Command_FSFREEZE_THAW Command = "fsfreeze-thaw" Command_FSTRIM Command = "fstrim" Command_GET_FSINFO Command = "get-fsinfo" Command_GET_HOST_NAME Command = "get-host-name" Command_GET_MEMORY_BLOCK_INFO Command = "get-memory-block-info" Command_GET_MEMORY_BLOCKS Command = "get-memory-blocks" Command_GET_OSINFO Command = "get-osinfo" Command_GET_TIME Command = "get-time" Command_GET_TIMEZONE Command = "get-timezone" Command_GET_USERS Command = "get-users" Command_GET_VCPUS Command = "get-vcpus" Command_INFO Command = "info" Command_NETWORK_GET_INTERFACES Command = "network-get-interfaces" Command_PING Command = "ping" Command_SHUTDOWN Command = "shutdown" Command_SUSPEND_DISK Command = "suspend-disk" Command_SUSPEND_HYBRID Command = "suspend-hybrid" Command_SUSPEND_RAM Command = "suspend-ram" )
func PtrCommand ¶ added in v0.0.15
type CreateRequest ¶
type ExecRequest ¶
type ExecRequest struct { Node string `url:"node" json:"node"` // The cluster node name. Vmid int `url:"vmid" json:"vmid"` // The (unique) ID of the VM. // The following parameters are optional Command *string `url:"command,omitempty" json:"command,omitempty"` // The command as a list of program + arguments InputData *string `url:"input-data,omitempty" json:"input-data,omitempty"` // Data to pass as 'input-data' to the guest. Usually treated as STDIN to 'command'. }
type ExecResponse ¶
type ExecResponse struct {
Pid int `url:"pid" json:"pid"` // The PID of the process started by the guest-agent.
}
type ExecStatusRequest ¶
type ExecStatusResponse ¶
type ExecStatusResponse struct { Exited util.PVEBool `url:"exited" json:"exited"` // Tells if the given command has exited yet. // The following parameters are optional ErrData *string `url:"err-data,omitempty" json:"err-data,omitempty"` // stderr of the process ErrTruncated *util.PVEBool `url:"err-truncated,omitempty" json:"err-truncated,omitempty"` // true if stderr was not fully captured Exitcode *int `url:"exitcode,omitempty" json:"exitcode,omitempty"` // process exit code if it was normally terminated. OutData *string `url:"out-data,omitempty" json:"out-data,omitempty"` // stdout of the process OutTruncated *util.PVEBool `url:"out-truncated,omitempty" json:"out-truncated,omitempty"` // true if stdout was not fully captured Signal *int `url:"signal,omitempty" json:"signal,omitempty"` // signal number or exception code if the process was abnormally terminated. }
type FileReadRequest ¶
type FileReadResponse ¶
type FileReadResponse struct { Content string `url:"content" json:"content"` // The content of the file, maximum 16777216 // The following parameters are optional Truncated *util.PVEBool `url:"truncated,omitempty" json:"truncated,omitempty"` // If set to 1, the output is truncated and not complete }
Returns an object with a `content` property.
type FileWriteRequest ¶
type FileWriteRequest struct { Content string `url:"content" json:"content"` // The content to write into the file. File string `url:"file" json:"file"` // The path to the file. Node string `url:"node" json:"node"` // The cluster node name. Vmid int `url:"vmid" json:"vmid"` // The (unique) ID of the VM. // The following parameters are optional Encode *util.PVEBool `url:"encode,omitempty" json:"encode,omitempty"` // If set, the content will be encoded as base64 (required by QEMU).Otherwise the content needs to be encoded beforehand - defaults to true. }
type FsfreezeFreezeRequest ¶
type FsfreezeStatusRequest ¶
type FsfreezeThawRequest ¶
type FstrimRequest ¶
type GetFsinfoRequest ¶
type GetHostNameRequest ¶
type GetMemoryBlocksRequest ¶
type GetOsinfoRequest ¶
type GetTimeRequest ¶
type GetTimezoneRequest ¶
type GetUsersRequest ¶
type GetVcpusRequest ¶
type HTTPClient ¶
type IndexRequest ¶
type InfoRequest ¶
type PingRequest ¶
type SetUserPasswordRequest ¶
type SetUserPasswordRequest struct { Node string `url:"node" json:"node"` // The cluster node name. Password string `url:"password" json:"password"` // The new password. Username string `url:"username" json:"username"` // The user to set the password for. Vmid int `url:"vmid" json:"vmid"` // The (unique) ID of the VM. // The following parameters are optional Crypted *util.PVEBool `url:"crypted,omitempty" json:"crypted,omitempty"` // set to 1 if the password has already been passed through crypt() }