resources

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c HTTPClient) *Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

Create Create a new HA resource.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)

Delete Delete resource configuration.

func (*Client) Find

func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)

Find Read resource configuration.

func (*Client) Index

func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)

Index List HA resources.

func (*Client) Migrate

func (c *Client) Migrate(ctx context.Context, req *MigrateRequest) (*MigrateResponse, error)

Migrate Request resource migration (online) to another node.

func (*Client) Relocate

func (c *Client) Relocate(ctx context.Context, req *RelocateRequest) (*RelocateResponse, error)

Relocate Request resource relocatzion to another node. This stops the service on the old node, and restarts it on the target node.

func (*Client) Update

func (c *Client) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)

Update Update resource configuration.

type CreateRequest

type CreateRequest struct {
	Sid string `url:"sid",json:"sid"` // HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).

	// The following parameters are optional
	Comment     *string `url:"comment,omitempty",json:"comment,omitempty"`           // Description.
	Group       *string `url:"group,omitempty",json:"group,omitempty"`               // The HA group identifier.
	MaxRelocate *int    `url:"max_relocate,omitempty",json:"max_relocate,omitempty"` // Maximal number of service relocate tries when a service failes to start.
	MaxRestart  *int    `url:"max_restart,omitempty",json:"max_restart,omitempty"`   // Maximal number of tries to restart the service on a node after its start failed.
	State       *string `url:"state,omitempty",json:"state,omitempty"`               // Requested resource state.
	Type        *string `url:"type,omitempty",json:"type,omitempty"`                 // Resource type.
}

type CreateResponse

type CreateResponse map[string]interface{}

type DeleteRequest

type DeleteRequest struct {
	Sid string `url:"sid",json:"sid"` // HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).

}

type DeleteResponse

type DeleteResponse map[string]interface{}

type FindRequest

type FindRequest struct {
	Sid string `url:"sid",json:"sid"` // HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).

}

type FindResponse

type FindResponse struct {
	Digest string `url:"digest",json:"digest"` // Can be used to prevent concurrent modifications.
	Sid    string `url:"sid",json:"sid"`       // HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).
	Type   string `url:"type",json:"type"`     // The type of the resources.

	// The following parameters are optional
	Comment     *string `url:"comment,omitempty",json:"comment,omitempty"`           // Description.
	Group       *string `url:"group,omitempty",json:"group,omitempty"`               // The HA group identifier.
	MaxRelocate *int    `url:"max_relocate,omitempty",json:"max_relocate,omitempty"` // Maximal number of service relocate tries when a service failes to start.
	MaxRestart  *int    `url:"max_restart,omitempty",json:"max_restart,omitempty"`   // Maximal number of tries to restart the service on a node after its start failed.
	State       *string `url:"state,omitempty",json:"state,omitempty"`               // Requested resource state.
}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexRequest

type IndexRequest map[string]interface{}

type IndexResponse

type IndexResponse []*struct {
	Sid string `url:"sid",json:"sid"`
}

type MigrateRequest

type MigrateRequest struct {
	Node string `url:"node",json:"node"` // Target node.
	Sid  string `url:"sid",json:"sid"`   // HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).

}

type MigrateResponse

type MigrateResponse map[string]interface{}

type RelocateRequest

type RelocateRequest struct {
	Node string `url:"node",json:"node"` // Target node.
	Sid  string `url:"sid",json:"sid"`   // HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).

}

type RelocateResponse

type RelocateResponse map[string]interface{}

type UpdateRequest

type UpdateRequest struct {
	Sid string `url:"sid",json:"sid"` // HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).

	// The following parameters are optional
	Comment     *string `url:"comment,omitempty",json:"comment,omitempty"`           // Description.
	Delete      *string `url:"delete,omitempty",json:"delete,omitempty"`             // A list of settings you want to delete.
	Digest      *string `url:"digest,omitempty",json:"digest,omitempty"`             // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
	Group       *string `url:"group,omitempty",json:"group,omitempty"`               // The HA group identifier.
	MaxRelocate *int    `url:"max_relocate,omitempty",json:"max_relocate,omitempty"` // Maximal number of service relocate tries when a service failes to start.
	MaxRestart  *int    `url:"max_restart,omitempty",json:"max_restart,omitempty"`   // Maximal number of tries to restart the service on a node after its start failed.
	State       *string `url:"state,omitempty",json:"state,omitempty"`               // Requested resource state.
}

type UpdateResponse

type UpdateResponse map[string]interface{}

Jump to

Keyboard shortcuts

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