Documentation ¶
Index ¶
- type CertificateDeleteRequestBody
- type CertificateListResponseBody
- type CertificateListResponseData
- type CertificateUpdateRequestBody
- type Client
- 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) 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) GetHosts(ctx context.Context) (*HostsGetResponseData, error)
- func (c *Client) GetInfo(ctx context.Context) (*GetInfoResponseData, error)
- func (c *Client) GetQueryURLMetadata(ctx context.Context, d *QueryURLMetadataGetRequestBody) (*QueryURLMetadataGetResponseData, error)
- func (c *Client) GetTime(ctx context.Context) (*GetTimeResponseData, error)
- func (c *Client) ListCertificates(ctx context.Context) (*[]CertificateListResponseData, 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) Storage(storageName string) *storage.Client
- 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 ExecuteRequestBody
- type GetInfoResponseBody
- type GetInfoResponseData
- type GetTimeResponseBody
- type GetTimeResponseData
- type HostsGetResponseBody
- type HostsGetResponseData
- type HostsUpdateRequestBody
- type ListResponseBody
- type ListResponseData
- type NetworkInterfaceCreateUpdateRequestBody
- type NetworkInterfaceListResponseBody
- type NetworkInterfaceListResponseData
- type QueryURLMetadataGetRequestBody
- type QueryURLMetadataGetResponseBody
- type QueryURLMetadataGetResponseData
- 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) Container ¶
func (c *Client) Container(vmID int) *containers.Client
Container returns a client for managing a specific container.
func (*Client) CreateNetworkInterface ¶ added in v0.22.0
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) DeleteNetworkInterface ¶ added in v0.22.0
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) GetHosts ¶
func (c *Client) GetHosts(ctx context.Context) (*HostsGetResponseData, error)
GetHosts retrieves the Hosts configuration for a node.
func (*Client) GetInfo ¶ added in v0.51.0
func (c *Client) GetInfo(ctx context.Context) (*GetInfoResponseData, error)
GetInfo retrieves the information of the node.
func (*Client) GetQueryURLMetadata ¶ added in v0.43.0
func (c *Client) GetQueryURLMetadata( ctx context.Context, d *QueryURLMetadataGetRequestBody, ) (*QueryURLMetadataGetResponseData, error)
GetQueryURLMetadata retrieves the URL filename details 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) ListNetworkInterfaces ¶ added in v0.22.0
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 ¶ added in v0.22.0
ReloadNetworkConfiguration reloads the network configuration for a specific node.
func (*Client) RevertNetworkConfiguration ¶ added in v0.22.0
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 ¶ added in v0.22.0
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 ExecuteRequestBody ¶
type ExecuteRequestBody struct {
Commands CustomCommands `json:"commands" url:"commands"`
}
ExecuteRequestBody contains the data for a node execute request.
type GetInfoResponseBody ¶ added in v0.51.0
type GetInfoResponseBody struct {
Data *GetInfoResponseData `json:"data,omitempty"`
}
GetInfoResponseBody contains the body from a node info get response.
type GetInfoResponseData ¶ added in v0.51.0
type GetInfoResponseData struct { CPUInfo struct { CPUCores *int `json:"cores,omitempty"` CPUSockets *int `json:"sockets,omitempty"` CPUModel *string `json:"model"` } `json:"cpuinfo"` MemoryInfo struct { Free *int `json:"free,omitempty"` Used *int `json:"used,omitempty"` Total *int `json:"total,omitempty"` } `json:"memory"` Uptime *int `json:"uptime"` }
GetInfoResponseData contains the data from a node info response.
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 ¶ added in v0.22.0
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 ¶ added in v0.22.0
type NetworkInterfaceListResponseBody struct {
Data []*NetworkInterfaceListResponseData `json:"data,omitempty"`
}
NetworkInterfaceListResponseBody contains the body from a node network interface list response.
type NetworkInterfaceListResponseData ¶ added in v0.22.0
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 QueryURLMetadataGetRequestBody ¶ added in v0.43.0
type QueryURLMetadataGetRequestBody struct { Verify *types.CustomBool `json:"verify-certificates,omitempty" url:"verify-certificates,omitempty,int"` URL *string `json:"url,omitempty" url:"url,omitempty"` }
QueryURLMetadataGetRequestBody contains the body for a QueryURLMetadata get request.
type QueryURLMetadataGetResponseBody ¶ added in v0.43.0
type QueryURLMetadataGetResponseBody struct {
Data *QueryURLMetadataGetResponseData `json:"data,omitempty"`
}
QueryURLMetadataGetResponseBody contains the body from a QueryURLMetadata get response.
type QueryURLMetadataGetResponseData ¶ added in v0.43.0
type QueryURLMetadataGetResponseData struct { Filename *string `json:"filename,omitempty" url:"filename,omitempty"` Mimetype *string `json:"mimetype,omitempty" url:"mimetype,omitempty"` Size *int64 `json:"size,omitempty" url:"size,omitempty"` }
QueryURLMetadataGetResponseData contains the data from a QueryURLMetadata get response.
type ReloadNetworkResponseBody ¶ added in v0.22.0
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.