nodes

package
v0.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2023 License: MPL-2.0 Imports: 15 Imported by: 6

Documentation

Index

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

type Client struct {
	api.Client
	NodeName string
}

Client is an interface for accessing the Proxmox node API.

func (*Client) APIUpload

func (c *Client) APIUpload(
	ctx context.Context,
	datastoreID string,
	d *api.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) DeleteCertificate

func (c *Client) DeleteCertificate(ctx context.Context, d *CertificateDeleteRequestBody) error

DeleteCertificate deletes the custom certificate for a node.

func (*Client) DeleteDatastoreFile

func (c *Client) DeleteDatastoreFile(
	ctx context.Context,
	datastoreID, volumeID string,
) error

DeleteDatastoreFile deletes a file in a datastore.

func (*Client) ExpandPath

func (c *Client) ExpandPath(path string) string

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) GetIP

func (c *Client) GetIP(ctx context.Context) (string, error)

GetIP retrieves the IP address of 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) ListNetworkDevices

func (c *Client) ListNetworkDevices(ctx context.Context) ([]*NetworkDeviceListResponseData, error)

ListNetworkDevices retrieves a list of network devices for a specific nodes.

func (*Client) ListNodes

func (c *Client) ListNodes(ctx context.Context) ([]*ListResponseData, error)

ListNodes retrieves a list of nodes.

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) UpdateTime

func (c *Client) UpdateTime(ctx context.Context, d *UpdateTimeRequestBody) error

UpdateTime updates the time on a node.

func (*Client) VM

func (c *Client) VM(vmID int) *vms.Client

VM returns a client for managing a specific VM.

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"`
	Shared         *types.CustomBool               `json:"shared,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"`
	Shared              *types.CustomBool               `json:"shared,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 NetworkDeviceListResponseBody

type NetworkDeviceListResponseBody struct {
	Data []*NetworkDeviceListResponseData `json:"data,omitempty"`
}

NetworkDeviceListResponseBody contains the body from a node network device list response.

type NetworkDeviceListResponseData

type NetworkDeviceListResponseData struct {
	Active      *types.CustomBool `json:"active,omitempty"`
	Address     *string           `json:"address,omitempty"`
	Autostart   *types.CustomBool `json:"autostart,omitempty"`
	BridgeFD    *string           `json:"bridge_fd,omitempty"`
	BridgePorts *string           `json:"bridge_ports,omitempty"`
	BridgeSTP   *string           `json:"bridge_stp,omitempty"`
	CIDR        *string           `json:"cidr,omitempty"`
	Exists      *types.CustomBool `json:"exists,omitempty"`
	Families    *[]string         `json:"families,omitempty"`
	Gateway     *string           `json:"gateway,omitempty"`
	Iface       string            `json:"iface"`
	MethodIPv4  *string           `json:"method,omitempty"`
	MethodIPv6  *string           `json:"method6,omitempty"`
	Netmask     *string           `json:"netmask,omitempty"`
	Priority    int               `json:"priority"`
	Type        string            `json:"type"`
}

NetworkDeviceListResponseData contains the data from a node network device list response.

type UpdateTimeRequestBody

type UpdateTimeRequestBody struct {
	TimeZone string `json:"timezone" url:"timezone"`
}

UpdateTimeRequestBody contains the body for a node time update request.

Directories

Path Synopsis
vms

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL