replication

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RemoveJob_LOCAL RemoveJob = "local"
	RemoveJob_FULL  RemoveJob = "full"

	Type_LOCAL Type = "local"
)

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 replication job

func (*Client) Delete

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

Delete Mark replication job for removal.

func (*Client) Find

func (c *Client) Find(ctx context.Context, req FindRequest) (map[string]interface{}, error)

Find Read replication job configuration.

func (*Client) Index

func (c *Client) Index(ctx context.Context) ([]map[string]interface{}, error)

Index List replication jobs.

func (*Client) Update

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

Update Update replication job configuration.

type CreateRequest

type CreateRequest struct {
	Id     string `url:"id" json:"id"`         // Replication Job ID. The ID is composed of a Guest ID and a job number, separated by a hyphen, i.e. '<GUEST>-<JOBNUM>'.
	Target string `url:"target" json:"target"` // Target node.
	Type   Type   `url:"type" json:"type"`     // Section type.

	// The following parameters are optional
	Comment   *string       `url:"comment,omitempty" json:"comment,omitempty"`       // Description.
	Disable   *util.PVEBool `url:"disable,omitempty" json:"disable,omitempty"`       // Flag to disable/deactivate the entry.
	Rate      *float64      `url:"rate,omitempty" json:"rate,omitempty"`             // Rate limit in mbps (megabytes per second) as floating point number.
	RemoveJob *RemoveJob    `url:"remove_job,omitempty" json:"remove_job,omitempty"` // Mark the replication job for removal. The job will remove all local replication snapshots. When set to 'full', it also tries to remove replicated volumes on the target. The job then removes itself from the configuration file.
	Schedule  *string       `url:"schedule,omitempty" json:"schedule,omitempty"`     // Storage replication schedule. The format is a subset of `systemd` calendar events.
	Source    *string       `url:"source,omitempty" json:"source,omitempty"`         // For internal use, to detect if the guest was stolen.
}

type DeleteRequest

type DeleteRequest struct {
	Id string `url:"id" json:"id"` // Replication Job ID. The ID is composed of a Guest ID and a job number, separated by a hyphen, i.e. '<GUEST>-<JOBNUM>'.

	// The following parameters are optional
	Force *util.PVEBool `url:"force,omitempty" json:"force,omitempty"` // Will remove the jobconfig entry, but will not cleanup.
	Keep  *util.PVEBool `url:"keep,omitempty" json:"keep,omitempty"`   // Keep replicated data at target (do not remove).
}

type FindRequest

type FindRequest struct {
	Id string `url:"id" json:"id"` // Replication Job ID. The ID is composed of a Guest ID and a job number, separated by a hyphen, i.e. '<GUEST>-<JOBNUM>'.

}

type HTTPClient

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

type RemoveJob added in v0.0.15

type RemoveJob string

func PtrRemoveJob added in v0.0.15

func PtrRemoveJob(i RemoveJob) *RemoveJob

type Type added in v0.0.15

type Type string

func PtrType added in v0.0.15

func PtrType(i Type) *Type

type UpdateRequest

type UpdateRequest struct {
	Id string `url:"id" json:"id"` // Replication Job ID. The ID is composed of a Guest ID and a job number, separated by a hyphen, i.e. '<GUEST>-<JOBNUM>'.

	// 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.
	Disable   *util.PVEBool `url:"disable,omitempty" json:"disable,omitempty"`       // Flag to disable/deactivate the entry.
	Rate      *float64      `url:"rate,omitempty" json:"rate,omitempty"`             // Rate limit in mbps (megabytes per second) as floating point number.
	RemoveJob *RemoveJob    `url:"remove_job,omitempty" json:"remove_job,omitempty"` // Mark the replication job for removal. The job will remove all local replication snapshots. When set to 'full', it also tries to remove replicated volumes on the target. The job then removes itself from the configuration file.
	Schedule  *string       `url:"schedule,omitempty" json:"schedule,omitempty"`     // Storage replication schedule. The format is a subset of `systemd` calendar events.
	Source    *string       `url:"source,omitempty" json:"source,omitempty"`         // For internal use, to detect if the guest was stolen.
}

Jump to

Keyboard shortcuts

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