resources

package
v0.43.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MPL-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	api.Client
}

Client is an interface for accessing the Proxmox High Availability resources management API.

func (*Client) Create

func (c *Client) Create(ctx context.Context, data *HAResourceCreateRequestBody) error

Create creates a new HA resource.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id types.HAResourceID) error

Delete deletes a HA resource.

func (*Client) ExpandPath

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

ExpandPath expands a relative path to the HA resources management API path.

func (*Client) Get

Get retrieves the configuration of a single HA resource.

func (*Client) List

List retrieves the list of HA resources. If the `resType` argument is `nil`, all resources will be returned; otherwise resources will be filtered by the specified type (either `ct` or `vm`).

func (*Client) Update

Update updates an existing HA resource.

type HAResourceCreateRequestBody

type HAResourceCreateRequestBody struct {
	HAResourceDataBase
	// Identifier of this resource
	ID types.HAResourceID `url:"sid"`
	// Type of this resource
	Type *types.HAResourceType `url:"type,omitempty"`
	// SHA-1 digest of the resources' configuration.
	Digest *string `url:"comment,omitempty"`
}

HAResourceCreateRequestBody contains data received from the HA resource API when creating a new HA resource.

type HAResourceDataBase

type HAResourceDataBase struct {
	// Resource comment, if defined
	Comment *string `json:"comment,omitempty" url:"comment,omitempty"`
	// HA group identifier, if the resource is part of one.
	Group *string `json:"group,omitempty" url:"group,omitempty"`
	// Maximal number of service relocation attempts.
	MaxRelocate *int64 `json:"max_relocate,omitempty" url:"max_relocate,omitempty"`
	// Maximal number of service restart attempts.
	MaxRestart *int64 `json:"max_restart" url:"max_restart,omitempty"`
	// Requested resource state.
	State types.HAResourceState `json:"state" url:"state"`
}

HAResourceDataBase contains data common to all HA resource API calls.

type HAResourceGetResponseBody

type HAResourceGetResponseBody struct {
	Data *HAResourceGetResponseData `json:"data,omitempty"`
}

HAResourceGetResponseBody contains the body from a HA resource get response.

type HAResourceGetResponseData

type HAResourceGetResponseData struct {
	HAResourceDataBase
	// Identifier of this resource
	ID types.HAResourceID `json:"sid"`
	// Type of this resource
	Type types.HAResourceType `json:"type"`
	// SHA-1 digest of the resources' configuration.
	Digest *string `json:"digest,omitempty"`
}

HAResourceGetResponseData contains data received from the HA resource API when requesting information about a single HA resource.

type HAResourceListResponseBody

type HAResourceListResponseBody struct {
	Data []*HAResourceListResponseData `json:"data,omitempty"`
}

HAResourceListResponseBody contains the body from a HA resource list response.

type HAResourceListResponseData

type HAResourceListResponseData struct {
	ID types.HAResourceID `json:"sid"`
}

HAResourceListResponseData contains the data from a HA resource list response.

type HAResourceUpdateRequestBody

type HAResourceUpdateRequestBody struct {
	HAResourceDataBase
	// Settings that must be deleted from the resource's configuration
	Delete []string `url:"delete,omitempty,comma"`
}

HAResourceUpdateRequestBody contains data received from the HA resource API when updating an existing HA resource.

Jump to

Keyboard shortcuts

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