Documentation ¶
Index ¶
- type CertificateDeleteRequestBody
- type CertificateListResponseBody
- type CertificateListResponseData
- type CertificateUpdateRequestBody
- type Client
- func (c *Client) APIUpload(ctx context.Context, datastoreID string, d *rest.FileUploadRequest) (*DatastoreUploadResponseBody, error)
- func (c *Client) Container(vmID int) *containers.Client
- func (c *Client) CreateNetworkInterface(ctx context.Context, d *NetworkInterfaceCreateUpdateRequestBody) error
- func (c *Client) DeleteCertificate(ctx context.Context, d *CertificateDeleteRequestBody) error
- func (c *Client) DeleteDatastoreFile(ctx context.Context, datastoreID, volumeID string) error
- func (c *Client) DeleteNetworkInterface(ctx context.Context, iface string) error
- func (c *Client) ExpandPath(path string) string
- func (c *Client) GetDNS(ctx context.Context) (*DNSGetResponseData, error)
- func (c *Client) GetDatastoreStatus(ctx context.Context, datastoreID string) (*DatastoreGetStatusResponseData, error)
- func (c *Client) GetHosts(ctx context.Context) (*HostsGetResponseData, error)
- func (c *Client) GetTime(ctx context.Context) (*GetTimeResponseData, error)
- func (c *Client) ListCertificates(ctx context.Context) (*[]CertificateListResponseData, error)
- func (c *Client) ListDatastoreFiles(ctx context.Context, datastoreID string) ([]*DatastoreFileListResponseData, error)
- func (c *Client) ListDatastores(ctx context.Context, d *DatastoreListRequestBody) ([]*DatastoreListResponseData, error)
- func (c *Client) ListNetworkInterfaces(ctx context.Context) ([]*NetworkInterfaceListResponseData, error)
- func (c *Client) ListNodes(ctx context.Context) ([]*ListResponseData, error)
- func (c *Client) ReloadNetworkConfiguration(ctx context.Context) error
- func (c *Client) RevertNetworkConfiguration(ctx context.Context) error
- func (c *Client) Tasks() *tasks.Client
- func (c *Client) UpdateCertificate(ctx context.Context, d *CertificateUpdateRequestBody) error
- func (c *Client) UpdateDNS(ctx context.Context, d *DNSUpdateRequestBody) error
- func (c *Client) UpdateHosts(ctx context.Context, d *HostsUpdateRequestBody) error
- func (c *Client) UpdateNetworkInterface(ctx context.Context, iface string, d *NetworkInterfaceCreateUpdateRequestBody) error
- func (c *Client) UpdateTime(ctx context.Context, d *UpdateTimeRequestBody) error
- func (c *Client) VM(vmID int) *vms.Client
- type CustomCommands
- type DNSGetResponseBody
- type DNSGetResponseData
- type DNSUpdateRequestBody
- type DatastoreFileListResponseBody
- type DatastoreFileListResponseData
- type DatastoreGetStatusResponseBody
- type DatastoreGetStatusResponseData
- type DatastoreListRequestBody
- type DatastoreListResponseBody
- type DatastoreListResponseData
- type DatastoreUploadResponseBody
- type ExecuteRequestBody
- type GetTimeResponseBody
- type GetTimeResponseData
- type HostsGetResponseBody
- type HostsGetResponseData
- type HostsUpdateRequestBody
- type ListResponseBody
- type ListResponseData
- type NetworkInterfaceCreateUpdateRequestBody
- type NetworkInterfaceListResponseBody
- type NetworkInterfaceListResponseData
- type ReloadNetworkResponseBody
- type UpdateTimeRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateDeleteRequestBody ¶
type CertificateDeleteRequestBody struct {
Restart *types.CustomBool `json:"restart,omitempty" url:"restart,omitempty,int"`
}
CertificateDeleteRequestBody contains the data for a custom certificate delete request.
type CertificateListResponseBody ¶
type CertificateListResponseBody struct {
Data *[]CertificateListResponseData `json:"data,omitempty"`
}
CertificateListResponseBody contains the body from a certificate list response.
type CertificateListResponseData ¶
type CertificateListResponseData struct { Certificates *string `json:"pem,omitempty"` FileName *string `json:"filename,omitempty"` Fingerprint *string `json:"fingerprint,omitempty"` Issuer *string `json:"issuer,omitempty"` NotAfter *types.CustomTimestamp `json:"notafter,omitempty"` NotBefore *types.CustomTimestamp `json:"notbefore,omitempty"` PublicKeyBits *int `json:"public-key-bits,omitempty"` PublicKeyType *string `json:"public-key-type,omitempty"` Subject *string `json:"subject,omitempty"` SubjectAlternativeNames *[]string `json:"san,omitempty"` }
CertificateListResponseData contains the data from a certificate list response.
type CertificateUpdateRequestBody ¶
type CertificateUpdateRequestBody struct { Certificates string `json:"certificates" url:"certificates"` Force *types.CustomBool `json:"force,omitempty" url:"force,omitempty,int"` PrivateKey *string `json:"key,omitempty" url:"key,omitempty"` Restart *types.CustomBool `json:"restart,omitempty" url:"restart,omitempty,int"` }
CertificateUpdateRequestBody contains the body for a custom certificate update request.
type Client ¶
Client is an interface for accessing the Proxmox node API.
func (*Client) APIUpload ¶
func (c *Client) APIUpload( ctx context.Context, datastoreID string, d *rest.FileUploadRequest, ) (*DatastoreUploadResponseBody, error)
APIUpload uploads a file to a datastore using the Proxmox API.
func (*Client) Container ¶
func (c *Client) Container(vmID int) *containers.Client
Container returns a client for managing a specific container.
func (*Client) CreateNetworkInterface ¶
func (c *Client) CreateNetworkInterface(ctx context.Context, d *NetworkInterfaceCreateUpdateRequestBody) error
CreateNetworkInterface creates a network interface for a specific node.
func (*Client) DeleteCertificate ¶
func (c *Client) DeleteCertificate(ctx context.Context, d *CertificateDeleteRequestBody) error
DeleteCertificate deletes the custom certificate for a node.
func (*Client) DeleteDatastoreFile ¶
DeleteDatastoreFile deletes a file in a datastore.
func (*Client) DeleteNetworkInterface ¶
DeleteNetworkInterface deletes a network interface configuration for a specific node.
func (*Client) ExpandPath ¶
ExpandPath expands a relative path to a full node API path.
func (*Client) GetDNS ¶
func (c *Client) GetDNS(ctx context.Context) (*DNSGetResponseData, error)
GetDNS retrieves the DNS configuration for a node.
func (*Client) GetDatastoreStatus ¶
func (c *Client) GetDatastoreStatus( ctx context.Context, datastoreID string, ) (*DatastoreGetStatusResponseData, error)
GetDatastoreStatus gets status information for a given datastore.
func (*Client) GetHosts ¶
func (c *Client) GetHosts(ctx context.Context) (*HostsGetResponseData, error)
GetHosts retrieves the Hosts configuration for a node.
func (*Client) GetTime ¶
func (c *Client) GetTime(ctx context.Context) (*GetTimeResponseData, error)
GetTime retrieves the time information for a node.
func (*Client) ListCertificates ¶
func (c *Client) ListCertificates(ctx context.Context) (*[]CertificateListResponseData, error)
ListCertificates retrieves the list of certificates for a node.
func (*Client) ListDatastoreFiles ¶
func (c *Client) ListDatastoreFiles( ctx context.Context, datastoreID string, ) ([]*DatastoreFileListResponseData, error)
ListDatastoreFiles retrieves a list of the files in a datastore.
func (*Client) ListDatastores ¶
func (c *Client) ListDatastores( ctx context.Context, d *DatastoreListRequestBody, ) ([]*DatastoreListResponseData, error)
ListDatastores retrieves a list of nodes.
func (*Client) ListNetworkInterfaces ¶
func (c *Client) ListNetworkInterfaces(ctx context.Context) ([]*NetworkInterfaceListResponseData, error)
ListNetworkInterfaces retrieves a list of network interfaces for a specific nodes.
func (*Client) ListNodes ¶
func (c *Client) ListNodes(ctx context.Context) ([]*ListResponseData, error)
ListNodes retrieves a list of nodes.
func (*Client) ReloadNetworkConfiguration ¶
ReloadNetworkConfiguration reloads the network configuration for a specific node.
func (*Client) RevertNetworkConfiguration ¶
RevertNetworkConfiguration reverts the network configuration changes for a specific node.
func (*Client) UpdateCertificate ¶
func (c *Client) UpdateCertificate(ctx context.Context, d *CertificateUpdateRequestBody) error
UpdateCertificate updates the custom certificate for a node.
func (*Client) UpdateDNS ¶
func (c *Client) UpdateDNS(ctx context.Context, d *DNSUpdateRequestBody) error
UpdateDNS updates the DNS configuration for a node.
func (*Client) UpdateHosts ¶
func (c *Client) UpdateHosts(ctx context.Context, d *HostsUpdateRequestBody) error
UpdateHosts updates the Hosts configuration for a node.
func (*Client) UpdateNetworkInterface ¶
func (c *Client) UpdateNetworkInterface( ctx context.Context, iface string, d *NetworkInterfaceCreateUpdateRequestBody, ) error
UpdateNetworkInterface updates a network interface for a specific node.
func (*Client) UpdateTime ¶
func (c *Client) UpdateTime(ctx context.Context, d *UpdateTimeRequestBody) error
UpdateTime updates the time on a node.
type CustomCommands ¶
type CustomCommands []string
CustomCommands contains an array of commands to execute.
func (CustomCommands) EncodeValues ¶
func (r CustomCommands) EncodeValues(key string, v *url.Values) error
EncodeValues converts a CustomCommands array to a JSON encoded URL value.
type DNSGetResponseBody ¶
type DNSGetResponseBody struct {
Data *DNSGetResponseData `json:"data,omitempty"`
}
DNSGetResponseBody contains the body from a DNS get response.
type DNSGetResponseData ¶
type DNSGetResponseData struct { Server1 *string `json:"dns1,omitempty" url:"dns1,omitempty"` Server2 *string `json:"dns2,omitempty" url:"dns2,omitempty"` Server3 *string `json:"dns3,omitempty" url:"dns3,omitempty"` SearchDomain *string `json:"search,omitempty" url:"search,omitempty"` }
DNSGetResponseData contains the data from a DNS get response.
type DNSUpdateRequestBody ¶
type DNSUpdateRequestBody struct { Server1 *string `json:"dns1,omitempty" url:"dns1,omitempty"` Server2 *string `json:"dns2,omitempty" url:"dns2,omitempty"` Server3 *string `json:"dns3,omitempty" url:"dns3,omitempty"` SearchDomain *string `json:"search,omitempty" url:"search,omitempty"` }
DNSUpdateRequestBody contains the body for a DNS update request.
type DatastoreFileListResponseBody ¶
type DatastoreFileListResponseBody struct {
Data []*DatastoreFileListResponseData `json:"data,omitempty"`
}
DatastoreFileListResponseBody contains the body from a datastore content list response.
type DatastoreFileListResponseData ¶
type DatastoreFileListResponseData struct { ContentType string `json:"content"` FileFormat string `json:"format"` FileSize int `json:"size"` ParentVolumeID *string `json:"parent,omitempty"` SpaceUsed *int `json:"used,omitempty"` VMID *int `json:"vmid,omitempty"` VolumeID string `json:"volid"` }
DatastoreFileListResponseData contains the data from a datastore content list response.
type DatastoreGetStatusResponseBody ¶
type DatastoreGetStatusResponseBody struct {
Data *DatastoreGetStatusResponseData `json:"data,omitempty"`
}
DatastoreGetStatusResponseBody contains the body from a datastore status get request.
type DatastoreGetStatusResponseData ¶
type DatastoreGetStatusResponseData struct { Active *types.CustomBool `json:"active,omitempty"` AvailableBytes *int64 `json:"avail,omitempty"` Content *types.CustomCommaSeparatedList `json:"content,omitempty" url:"content,omitempty,comma"` Enabled *types.CustomBool `json:"enabled,omitempty"` TotalBytes *int64 `json:"total,omitempty"` Type *string `json:"type,omitempty"` UsedBytes *int64 `json:"used,omitempty"` }
DatastoreGetStatusResponseData contains the data from a datastore status get request.
type DatastoreListRequestBody ¶
type DatastoreListRequestBody struct { ContentTypes types.CustomCommaSeparatedList `json:"content,omitempty" url:"content,omitempty,comma"` Enabled *types.CustomBool `json:"enabled,omitempty" url:"enabled,omitempty,int"` Format *types.CustomBool `json:"format,omitempty" url:"format,omitempty,int"` ID *string `json:"storage,omitempty" url:"storage,omitempty"` Target *string `json:"target,omitempty" url:"target,omitempty"` }
DatastoreListRequestBody contains the body for a datastore list request.
type DatastoreListResponseBody ¶
type DatastoreListResponseBody struct {
Data []*DatastoreListResponseData `json:"data,omitempty"`
}
DatastoreListResponseBody contains the body from a datastore list response.
type DatastoreListResponseData ¶
type DatastoreListResponseData struct { Active *types.CustomBool `json:"active,omitempty"` ContentTypes *types.CustomCommaSeparatedList `json:"content,omitempty"` Enabled *types.CustomBool `json:"enabled,omitempty"` ID string `json:"storage,omitempty"` SpaceAvailable *int `json:"avail,omitempty"` SpaceTotal *int `json:"total,omitempty"` SpaceUsed *int `json:"used,omitempty"` SpaceUsedPercentage *float64 `json:"used_fraction,omitempty"` Type string `json:"type,omitempty"` }
DatastoreListResponseData contains the data from a datastore list response.
type DatastoreUploadResponseBody ¶
type DatastoreUploadResponseBody struct {
UploadID *string `json:"data,omitempty"`
}
DatastoreUploadResponseBody contains the body from a datastore upload response.
type ExecuteRequestBody ¶
type ExecuteRequestBody struct {
Commands CustomCommands `json:"commands" url:"commands"`
}
ExecuteRequestBody contains the data for a node execute request.
type GetTimeResponseBody ¶
type GetTimeResponseBody struct {
Data *GetTimeResponseData `json:"data,omitempty"`
}
GetTimeResponseBody contains the body from a node time zone get response.
type GetTimeResponseData ¶
type GetTimeResponseData struct { LocalTime types.CustomTimestamp `json:"localtime"` TimeZone string `json:"timezone"` UTCTime types.CustomTimestamp `json:"time"` }
GetTimeResponseData contains the data from a node list response.
type HostsGetResponseBody ¶
type HostsGetResponseBody struct {
Data *HostsGetResponseData `json:"data,omitempty"`
}
HostsGetResponseBody contains the body from a hosts get response.
type HostsGetResponseData ¶
type HostsGetResponseData struct { Data string `json:"data"` Digest *string `json:"digest,omitempty"` }
HostsGetResponseData contains the data from a hosts get response.
type HostsUpdateRequestBody ¶
type HostsUpdateRequestBody struct { Data string `json:"data" url:"data"` Digest *string `json:"digest,omitempty" url:"digest,omitempty"` }
HostsUpdateRequestBody contains the body for a hosts update request.
type ListResponseBody ¶
type ListResponseBody struct {
Data []*ListResponseData `json:"data,omitempty"`
}
ListResponseBody contains the body from a node list response.
type ListResponseData ¶
type ListResponseData struct { CPUCount *int `json:"maxcpu,omitempty"` CPUUtilization *float64 `json:"cpu,omitempty"` MemoryAvailable *int `json:"maxmem,omitempty"` MemoryUsed *int `json:"mem,omitempty"` Name string `json:"node"` SSLFingerprint *string `json:"ssl_fingerprint,omitempty"` Status *string `json:"status"` SupportLevel *string `json:"level,omitempty"` Uptime *int `json:"uptime"` }
ListResponseData contains the data from a node list response.
type NetworkInterfaceCreateUpdateRequestBody ¶
type NetworkInterfaceCreateUpdateRequestBody struct { Iface string `json:"iface" url:"iface"` Type string `json:"type" url:"type"` Address *string `json:"address,omitempty" url:"address,omitempty"` Address6 *string `json:"address6,omitempty" url:"address6,omitempty"` Autostart *types.CustomBool `json:"autostart,omitempty" url:"autostart,omitempty,int"` BondPrimary *string `json:"bond-primary,omitempty" url:"bond-primary,omitempty"` BondMode *string `json:"bond_mode,omitempty" url:"bond_mode,omitempty"` BondXmitHashPolicy *string `json:"bond_xmit_hash_policy,omitempty" url:"bond_xmit_hash_policy,omitempty"` BridgePorts *string `json:"bridge_ports,omitempty" url:"bridge_ports,omitempty"` BridgeVLANAware *types.CustomBool `json:"bridge_vlan_aware,omitempty" url:"bridge_vlan_aware,omitempty,int"` CIDR *string `json:"cidr,omitempty" url:"cidr,omitempty"` CIDR6 *string `json:"cidr6,omitempty" url:"cidr6,omitempty"` Comments *string `json:"comments,omitempty" url:"comments,omitempty"` Comments6 *string `json:"comments6,omitempty" url:"comments6,omitempty"` Gateway *string `json:"gateway,omitempty" url:"gateway,omitempty"` Gateway6 *string `json:"gateway6,omitempty" url:"gateway6,omitempty"` Delete *[]string `json:"delete,omitempty" url:"delete,omitempty"` MTU *int64 `json:"mtu,omitempty" url:"mtu,omitempty"` Netmask *string `json:"netmask,omitempty" url:"netmask,omitempty"` Netmask6 *string `json:"netmask6,omitempty" url:"netmask6,omitempty"` OVSBonds *string `json:"ovs_bonds,omitempty" url:"ovs_bonds,omitempty"` OVSBridge *string `json:"ovs_bridge,omitempty" url:"ovs_bridge,omitempty"` OVSOptions *string `json:"ovs_options,omitempty" url:"ovs_options,omitempty"` OVSPorts *string `json:"ovs_ports,omitempty" url:"ovs_ports,omitempty"` OVSTag *string `json:"ovs_tag,omitempty" url:"ovs_tag,omitempty"` Slaves *string `json:"slaves,omitempty" url:"slaves,omitempty"` VLANID *int64 `json:"vlan_id,omitempty" url:"vlan_id,omitempty"` VLANRawDevice *string `json:"vlan-raw-device,omitempty" url:"vlan-raw-device,omitempty"` }
NetworkInterfaceCreateUpdateRequestBody contains the body for a node network interface create / update request.
type NetworkInterfaceListResponseBody ¶
type NetworkInterfaceListResponseBody struct {
Data []*NetworkInterfaceListResponseData `json:"data,omitempty"`
}
NetworkInterfaceListResponseBody contains the body from a node network interface list response.
type NetworkInterfaceListResponseData ¶
type NetworkInterfaceListResponseData struct { Active *types.CustomBool `json:"active,omitempty"` Address *string `json:"address,omitempty"` Address6 *string `json:"address6,omitempty"` Autostart *types.CustomBool `json:"autostart,omitempty"` BridgePorts *string `json:"bridge_ports,omitempty"` BridgeSTP *string `json:"bridge_stp,omitempty"` BridgeVIDs *string `json:"bridge_vids,omitempty"` BridgeVLANAware *types.CustomBool `json:"bridge_vlan_aware,omitempty"` CIDR *string `json:"cidr,omitempty"` CIDR6 *string `json:"cidr6,omitempty"` Comments *string `json:"comments,omitempty"` Exists *types.CustomBool `json:"exists,omitempty"` Families *[]string `json:"families,omitempty"` Gateway *string `json:"gateway,omitempty"` Gateway6 *string `json:"gateway6,omitempty"` Iface string `json:"iface"` MethodIPv4 *string `json:"method,omitempty"` MethodIPv6 *string `json:"method6,omitempty"` MTU *string `json:"mtu,omitempty"` Netmask *string `json:"netmask,omitempty"` VLANID *string `json:"vlan-id,omitempty"` VLANRawDevice *string `json:"vlan-raw-device,omitempty"` Priority int `json:"priority"` Type string `json:"type"` }
NetworkInterfaceListResponseData contains the data from a node network interface list response.
type ReloadNetworkResponseBody ¶
type ReloadNetworkResponseBody struct {
Data *string `json:"data,omitempty"`
}
ReloadNetworkResponseBody contains the body from a node network reload response.
type UpdateTimeRequestBody ¶
type UpdateTimeRequestBody struct {
TimeZone string `json:"timezone" url:"timezone"`
}
UpdateTimeRequestBody contains the body for a node time update request.