Documentation ¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, 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) (*FileWriteResponse, error)
- func (c *Client) FsfreezeFreeze(ctx context.Context, req *FsfreezeFreezeRequest) (*FsfreezeFreezeResponse, error)
- func (c *Client) FsfreezeStatus(ctx context.Context, req *FsfreezeStatusRequest) (*FsfreezeStatusResponse, error)
- func (c *Client) FsfreezeThaw(ctx context.Context, req *FsfreezeThawRequest) (*FsfreezeThawResponse, error)
- func (c *Client) Fstrim(ctx context.Context, req *FstrimRequest) (*FstrimResponse, error)
- func (c *Client) GetFsinfo(ctx context.Context, req *GetFsinfoRequest) (*GetFsinfoResponse, error)
- func (c *Client) GetHostName(ctx context.Context, req *GetHostNameRequest) (*GetHostNameResponse, error)
- func (c *Client) GetMemoryBlockInfo(ctx context.Context, req *GetMemoryBlockInfoRequest) (*GetMemoryBlockInfoResponse, error)
- func (c *Client) GetMemoryBlocks(ctx context.Context, req *GetMemoryBlocksRequest) (*GetMemoryBlocksResponse, error)
- func (c *Client) GetOsinfo(ctx context.Context, req *GetOsinfoRequest) (*GetOsinfoResponse, error)
- func (c *Client) GetTime(ctx context.Context, req *GetTimeRequest) (*GetTimeResponse, error)
- func (c *Client) GetTimezone(ctx context.Context, req *GetTimezoneRequest) (*GetTimezoneResponse, error)
- func (c *Client) GetUsers(ctx context.Context, req *GetUsersRequest) (*GetUsersResponse, error)
- func (c *Client) GetVcpus(ctx context.Context, req *GetVcpusRequest) (*GetVcpusResponse, error)
- func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)
- func (c *Client) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error)
- func (c *Client) NetworkGetInterfaces(ctx context.Context, req *NetworkGetInterfacesRequest) (*NetworkGetInterfacesResponse, error)
- func (c *Client) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error)
- func (c *Client) SetUserPassword(ctx context.Context, req *SetUserPasswordRequest) (*SetUserPasswordResponse, error)
- func (c *Client) Shutdown(ctx context.Context, req *ShutdownRequest) (*ShutdownResponse, error)
- func (c *Client) SuspendDisk(ctx context.Context, req *SuspendDiskRequest) (*SuspendDiskResponse, error)
- func (c *Client) SuspendHybrid(ctx context.Context, req *SuspendHybridRequest) (*SuspendHybridResponse, error)
- func (c *Client) SuspendRam(ctx context.Context, req *SuspendRamRequest) (*SuspendRamResponse, error)
- type CreateRequest
- type CreateResponse
- type ExecRequest
- type ExecResponse
- type ExecStatusRequest
- type ExecStatusResponse
- type FileReadRequest
- type FileReadResponse
- type FileWriteRequest
- type FileWriteResponse
- type FsfreezeFreezeRequest
- type FsfreezeFreezeResponse
- type FsfreezeStatusRequest
- type FsfreezeStatusResponse
- type FsfreezeThawRequest
- type FsfreezeThawResponse
- type FstrimRequest
- type FstrimResponse
- type GetFsinfoRequest
- type GetFsinfoResponse
- type GetHostNameRequest
- type GetHostNameResponse
- type GetMemoryBlockInfoRequest
- type GetMemoryBlockInfoResponse
- type GetMemoryBlocksRequest
- type GetMemoryBlocksResponse
- type GetOsinfoRequest
- type GetOsinfoResponse
- type GetTimeRequest
- type GetTimeResponse
- type GetTimezoneRequest
- type GetTimezoneResponse
- type GetUsersRequest
- type GetUsersResponse
- type GetVcpusRequest
- type GetVcpusResponse
- type HTTPClient
- type IndexRequest
- type IndexResponse
- type InfoRequest
- type InfoResponse
- type NetworkGetInterfacesRequest
- type NetworkGetInterfacesResponse
- type PingRequest
- type PingResponse
- type SetUserPasswordRequest
- type SetUserPasswordResponse
- type ShutdownRequest
- type ShutdownResponse
- type SuspendDiskRequest
- type SuspendDiskResponse
- type SuspendHybridRequest
- type SuspendHybridResponse
- type SuspendRamRequest
- type SuspendRamResponse
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) Create ¶
func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)
Create Execute Qemu Guest Agent commands.
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) (*FileWriteResponse, error)
FileWrite Writes the given file via guest agent.
func (*Client) FsfreezeFreeze ¶
func (c *Client) FsfreezeFreeze(ctx context.Context, req *FsfreezeFreezeRequest) (*FsfreezeFreezeResponse, error)
FsfreezeFreeze Execute fsfreeze-freeze.
func (*Client) FsfreezeStatus ¶
func (c *Client) FsfreezeStatus(ctx context.Context, req *FsfreezeStatusRequest) (*FsfreezeStatusResponse, error)
FsfreezeStatus Execute fsfreeze-status.
func (*Client) FsfreezeThaw ¶
func (c *Client) FsfreezeThaw(ctx context.Context, req *FsfreezeThawRequest) (*FsfreezeThawResponse, error)
FsfreezeThaw Execute fsfreeze-thaw.
func (*Client) Fstrim ¶
func (c *Client) Fstrim(ctx context.Context, req *FstrimRequest) (*FstrimResponse, error)
Fstrim Execute fstrim.
func (*Client) GetFsinfo ¶
func (c *Client) GetFsinfo(ctx context.Context, req *GetFsinfoRequest) (*GetFsinfoResponse, error)
GetFsinfo Execute get-fsinfo.
func (*Client) GetHostName ¶
func (c *Client) GetHostName(ctx context.Context, req *GetHostNameRequest) (*GetHostNameResponse, error)
GetHostName Execute get-host-name.
func (*Client) GetMemoryBlockInfo ¶
func (c *Client) GetMemoryBlockInfo(ctx context.Context, req *GetMemoryBlockInfoRequest) (*GetMemoryBlockInfoResponse, error)
GetMemoryBlockInfo Execute get-memory-block-info.
func (*Client) GetMemoryBlocks ¶
func (c *Client) GetMemoryBlocks(ctx context.Context, req *GetMemoryBlocksRequest) (*GetMemoryBlocksResponse, error)
GetMemoryBlocks Execute get-memory-blocks.
func (*Client) GetOsinfo ¶
func (c *Client) GetOsinfo(ctx context.Context, req *GetOsinfoRequest) (*GetOsinfoResponse, error)
GetOsinfo Execute get-osinfo.
func (*Client) GetTime ¶
func (c *Client) GetTime(ctx context.Context, req *GetTimeRequest) (*GetTimeResponse, error)
GetTime Execute get-time.
func (*Client) GetTimezone ¶
func (c *Client) GetTimezone(ctx context.Context, req *GetTimezoneRequest) (*GetTimezoneResponse, error)
GetTimezone Execute get-timezone.
func (*Client) GetUsers ¶
func (c *Client) GetUsers(ctx context.Context, req *GetUsersRequest) (*GetUsersResponse, error)
GetUsers Execute get-users.
func (*Client) GetVcpus ¶
func (c *Client) GetVcpus(ctx context.Context, req *GetVcpusRequest) (*GetVcpusResponse, error)
GetVcpus Execute get-vcpus.
func (*Client) Index ¶
func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)
Index Qemu Agent command index.
func (*Client) Info ¶
func (c *Client) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error)
Info Execute info.
func (*Client) NetworkGetInterfaces ¶
func (c *Client) NetworkGetInterfaces(ctx context.Context, req *NetworkGetInterfacesRequest) (*NetworkGetInterfacesResponse, error)
NetworkGetInterfaces Execute network-get-interfaces.
func (*Client) Ping ¶
func (c *Client) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error)
Ping Execute ping.
func (*Client) SetUserPassword ¶
func (c *Client) SetUserPassword(ctx context.Context, req *SetUserPasswordRequest) (*SetUserPasswordResponse, error)
SetUserPassword Sets the password for the given user to the given password
func (*Client) Shutdown ¶
func (c *Client) Shutdown(ctx context.Context, req *ShutdownRequest) (*ShutdownResponse, error)
Shutdown Execute shutdown.
func (*Client) SuspendDisk ¶
func (c *Client) SuspendDisk(ctx context.Context, req *SuspendDiskRequest) (*SuspendDiskResponse, error)
SuspendDisk Execute suspend-disk.
func (*Client) SuspendHybrid ¶
func (c *Client) SuspendHybrid(ctx context.Context, req *SuspendHybridRequest) (*SuspendHybridResponse, error)
SuspendHybrid Execute suspend-hybrid.
func (*Client) SuspendRam ¶
func (c *Client) SuspendRam(ctx context.Context, req *SuspendRamRequest) (*SuspendRamResponse, error)
SuspendRam Execute suspend-ram.
type CreateRequest ¶
type CreateResponse ¶
type CreateResponse map[string]interface{}
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 bool `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 *bool `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 *bool `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 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 *bool `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 FileWriteResponse ¶
type FileWriteResponse map[string]interface{}
type FsfreezeFreezeRequest ¶
type FsfreezeFreezeResponse ¶
type FsfreezeFreezeResponse map[string]interface{}
type FsfreezeStatusRequest ¶
type FsfreezeStatusResponse ¶
type FsfreezeStatusResponse map[string]interface{}
type FsfreezeThawRequest ¶
type FsfreezeThawResponse ¶
type FsfreezeThawResponse map[string]interface{}
type FstrimRequest ¶
type FstrimResponse ¶
type FstrimResponse map[string]interface{}
type GetFsinfoRequest ¶
type GetFsinfoResponse ¶
type GetFsinfoResponse map[string]interface{}
type GetHostNameRequest ¶
type GetHostNameResponse ¶
type GetHostNameResponse map[string]interface{}
type GetMemoryBlockInfoResponse ¶
type GetMemoryBlockInfoResponse map[string]interface{}
type GetMemoryBlocksRequest ¶
type GetMemoryBlocksResponse ¶
type GetMemoryBlocksResponse map[string]interface{}
type GetOsinfoRequest ¶
type GetOsinfoResponse ¶
type GetOsinfoResponse map[string]interface{}
type GetTimeRequest ¶
type GetTimeResponse ¶
type GetTimeResponse map[string]interface{}
type GetTimezoneRequest ¶
type GetTimezoneResponse ¶
type GetTimezoneResponse map[string]interface{}
type GetUsersRequest ¶
type GetUsersResponse ¶
type GetUsersResponse map[string]interface{}
type GetVcpusRequest ¶
type GetVcpusResponse ¶
type GetVcpusResponse map[string]interface{}
type HTTPClient ¶
type IndexRequest ¶
type IndexResponse ¶
type IndexResponse []*map[string]interface{}
type InfoRequest ¶
type InfoResponse ¶
type InfoResponse map[string]interface{}
type NetworkGetInterfacesResponse ¶
type NetworkGetInterfacesResponse map[string]interface{}
type PingRequest ¶
type PingResponse ¶
type PingResponse map[string]interface{}
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 *bool `url:"crypted,omitempty",json:"crypted,omitempty"` // set to 1 if the password has already been passed through crypt() }
type SetUserPasswordResponse ¶
type SetUserPasswordResponse map[string]interface{}
type ShutdownRequest ¶
type ShutdownResponse ¶
type ShutdownResponse map[string]interface{}
type SuspendDiskRequest ¶
type SuspendDiskResponse ¶
type SuspendDiskResponse map[string]interface{}
type SuspendHybridRequest ¶
type SuspendHybridResponse ¶
type SuspendHybridResponse map[string]interface{}
type SuspendRamRequest ¶
type SuspendRamResponse ¶
type SuspendRamResponse map[string]interface{}