groups

package
v0.48.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 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 groups API.

func (*Client) Create

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

Create creates a new HA group.

func (*Client) Delete

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

Delete deletes a HA group.

func (*Client) ExpandPath

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

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

func (*Client) Get

func (c *Client) Get(ctx context.Context, groupID string) (*HAGroupGetResponseData, error)

Get retrieves a single HA group based on its identifier.

func (*Client) List

func (c *Client) List(ctx context.Context) ([]*HAGroupListResponseData, error)

List retrieves the list of HA groups.

func (*Client) Update

func (c *Client) Update(ctx context.Context, groupID string, data *HAGroupUpdateRequestBody) error

Update updates a HA group's configuration.

type HAGroupCreateRequestBody

type HAGroupCreateRequestBody struct {
	// The group's data
	HAGroupDataBase
	// The group's identifier
	ID string `url:"group"`
	// The type. Always set to `group`.
	Type string `url:"type"`
}

HAGroupCreateRequestBody contains the data which must be sent when creating a HA group.

type HAGroupDataBase

type HAGroupDataBase struct {
	// A SHA1 digest of the group's configuration.
	Digest *string `json:"digest,omitempty" url:"digest,omitempty"`
	// The group's comment, if defined
	Comment *string `json:"comment,omitempty" url:"comment,omitempty"`
	// A comma-separated list of node fields. Each node field contains a node name, and may
	// include a priority, with a semicolon acting as a separator.
	Nodes string `json:"nodes" url:"nodes"`
	// A boolean (0/1) indicating that failing back to the highest priority node is disabled.
	NoFailback types.CustomBool `json:"nofailback" url:"nofailback,int"`
	// A boolean (0/1) indicating that associated resources cannot run on other nodes.
	Restricted types.CustomBool `json:"restricted" url:"restricted,int"`
}

HAGroupDataBase contains fields which are both received from and send to the HA group API.

type HAGroupGetResponseBody

type HAGroupGetResponseBody struct {
	Data *HAGroupGetResponseData `json:"data,omitempty"`
}

HAGroupGetResponseBody contains the body from a HA group get response.

type HAGroupGetResponseData

type HAGroupGetResponseData struct {
	// The group's data
	HAGroupDataBase
	// The group's identifier
	ID string `json:"group"`
	// The type. Always set to `group`.
	Type string `json:"type"`
}

HAGroupGetResponseData contains the data from a HA group get response.

type HAGroupListResponseBody

type HAGroupListResponseBody struct {
	Data []*HAGroupListResponseData `json:"data,omitempty"`
}

HAGroupListResponseBody contains the body from a HA group list response.

type HAGroupListResponseData

type HAGroupListResponseData struct {
	ID string `json:"group"`
}

HAGroupListResponseData contains the data from a HA group list response.

type HAGroupUpdateRequestBody

type HAGroupUpdateRequestBody struct {
	// The group's data
	HAGroupDataBase
	// A list of settings to delete
	Delete string `url:"delete"`
}

HAGroupUpdateRequestBody contains the data which must be sent when updating a HA group.

Jump to

Keyboard shortcuts

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