Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - type Client
 - func (c *Client) Create(ctx context.Context, req CreateRequest) error
 - func (c *Client) Delete(ctx context.Context, req DeleteRequest) error
 - func (c *Client) Find(ctx context.Context, req FindRequest) (FindResponse, error)
 - func (c *Client) Index(ctx context.Context, req IndexRequest) ([]IndexResponse, error)
 - func (c *Client) Migrate(ctx context.Context, req MigrateRequest) error
 - func (c *Client) Relocate(ctx context.Context, req RelocateRequest) error
 - func (c *Client) Update(ctx context.Context, req UpdateRequest) error
 
- type CreateRequest
 - type DeleteRequest
 - type FindRequest
 - type FindResponse
 - type HTTPClient
 - type IndexRequest
 - type IndexResponse
 - type MigrateRequest
 - type RelocateRequest
 - type State
 - type Type
 - type UpdateRequest
 
Constants ¶
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) error
Create Create a new HA resource.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, req DeleteRequest) 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) error
Migrate Request resource migration (online) to another node.
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       *State  `url:"state,omitempty" json:"state,omitempty"`               // Requested resource state.
	Type        *Type   `url:"type,omitempty" json:"type,omitempty"`                 // Resource type.
}
    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 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       *State  `url:"state,omitempty" json:"state,omitempty"`               // Requested resource state.
}
    type HTTPClient ¶
type IndexRequest ¶
type IndexRequest struct {
	// The following parameters are optional
	Type *Type `url:"type,omitempty" json:"type,omitempty"` // Only list resources of specific type
}
    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 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 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       *State  `url:"state,omitempty" json:"state,omitempty"`               // Requested resource state.
}
     Click to show internal directories. 
   Click to hide internal directories.