Documentation ¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, data *HAResourceCreateRequestBody) error
- func (c *Client) Delete(ctx context.Context, id types.HAResourceID) error
- func (c *Client) ExpandPath(path string) string
- func (c *Client) Get(ctx context.Context, id types.HAResourceID) (*HAResourceGetResponseData, error)
- func (c *Client) List(ctx context.Context, resType *types.HAResourceType) ([]*HAResourceListResponseData, error)
- func (c *Client) Update(ctx context.Context, id types.HAResourceID, data *HAResourceUpdateRequestBody) error
- type HAResourceCreateRequestBody
- type HAResourceDataBase
- type HAResourceGetResponseBody
- type HAResourceGetResponseData
- type HAResourceListResponseBody
- type HAResourceListResponseData
- type HAResourceUpdateRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type 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) ExpandPath ¶
ExpandPath expands a relative path to the HA resources management API path.
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, id types.HAResourceID) (*HAResourceGetResponseData, error)
Get retrieves the configuration of a single HA resource.
func (*Client) List ¶
func (c *Client) List(ctx context.Context, resType *types.HAResourceType) ([]*HAResourceListResponseData, error)
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 ¶
func (c *Client) Update(ctx context.Context, id types.HAResourceID, data *HAResourceUpdateRequestBody) error
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.