storage

package
v0.0.3 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) DeletePrunebackups

func (c *Client) DeletePrunebackups(ctx context.Context, req *DeletePrunebackupsRequest) (*DeletePrunebackupsResponse, error)

DeletePrunebackups Prune backups. Only those using the standard naming scheme are considered.

func (*Client) DownloadUrl

func (c *Client) DownloadUrl(ctx context.Context, req *DownloadUrlRequest) (*DownloadUrlResponse, error)

DownloadUrl Download templates and ISO images by using an URL.

func (*Client) DryrunPrunebackups

func (c *Client) DryrunPrunebackups(ctx context.Context, req *DryrunPrunebackupsRequest) (*DryrunPrunebackupsResponse, error)

DryrunPrunebackups Get prune information for backups. NOTE: this is only a preview and might not be what a subsequent prune call does if backups are removed/added in the meantime.

func (*Client) Find

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

Find

func (*Client) Index

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

Index Get status for all datastores.

func (*Client) ReadStatus

func (c *Client) ReadStatus(ctx context.Context, req *ReadStatusRequest) (*ReadStatusResponse, error)

ReadStatus Read storage status.

func (*Client) Rrd

func (c *Client) Rrd(ctx context.Context, req *RrdRequest) (*RrdResponse, error)

Rrd Read storage RRD statistics (returns PNG).

func (*Client) Rrddata

func (c *Client) Rrddata(ctx context.Context, req *RrddataRequest) (*RrddataResponse, error)

Rrddata Read storage RRD statistics.

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, req *UploadRequest) (*UploadResponse, error)

Upload Upload templates and ISO images.

type DeletePrunebackupsRequest

type DeletePrunebackupsRequest struct {
	Node    string `url:"node",json:"node"`       // The cluster node name.
	Storage string `url:"storage",json:"storage"` // The storage identifier.

	// The following parameters are optional
	PruneBackups *string `url:"prune-backups,omitempty",json:"prune-backups,omitempty"` // Use these retention options instead of those from the storage configuration.
	Type         *string `url:"type,omitempty",json:"type,omitempty"`                   // Either 'qemu' or 'lxc'. Only consider backups for guests of this type.
	Vmid         *int    `url:"vmid,omitempty",json:"vmid,omitempty"`                   // Only prune backups for this VM.
}

type DeletePrunebackupsResponse

type DeletePrunebackupsResponse string

type DownloadUrlRequest

type DownloadUrlRequest struct {
	Content  string `url:"content",json:"content"`   // Content type.
	Filename string `url:"filename",json:"filename"` // The name of the file to create. Caution: This will be normalized!
	Node     string `url:"node",json:"node"`         // The cluster node name.
	Storage  string `url:"storage",json:"storage"`   // The storage identifier.
	Url      string `url:"url",json:"url"`           // The URL to download the file from.

	// The following parameters are optional
	Checksum           *string `url:"checksum,omitempty",json:"checksum,omitempty"`                       // The expected checksum of the file.
	ChecksumAlgorithm  *string `url:"checksum-algorithm,omitempty",json:"checksum-algorithm,omitempty"`   // The algorithm to calculate the checksum of the file.
	VerifyCertificates *bool   `url:"verify-certificates,omitempty",json:"verify-certificates,omitempty"` // If false, no SSL/TLS certificates will be verified.
}

type DownloadUrlResponse

type DownloadUrlResponse string

type DryrunPrunebackupsRequest

type DryrunPrunebackupsRequest struct {
	Node    string `url:"node",json:"node"`       // The cluster node name.
	Storage string `url:"storage",json:"storage"` // The storage identifier.

	// The following parameters are optional
	PruneBackups *string `url:"prune-backups,omitempty",json:"prune-backups,omitempty"` // Use these retention options instead of those from the storage configuration.
	Type         *string `url:"type,omitempty",json:"type,omitempty"`                   // Either 'qemu' or 'lxc'. Only consider backups for guests of this type.
	Vmid         *int    `url:"vmid,omitempty",json:"vmid,omitempty"`                   // Only consider backups for this guest.
}

type DryrunPrunebackupsResponse

type DryrunPrunebackupsResponse []*struct {
	Ctime int    `url:"ctime",json:"ctime"` // Creation time of the backup (seconds since the UNIX epoch).
	Mark  string `url:"mark",json:"mark"`   // Whether the backup would be kept or removed. Backups that are protected or don't use the standard naming scheme are not removed.
	Type  string `url:"type",json:"type"`   // One of 'qemu', 'lxc', 'openvz' or 'unknown'.
	Volid string `url:"volid",json:"volid"` // Backup volume ID.

	// The following parameters are optional
	Vmid *int `url:"vmid,omitempty",json:"vmid,omitempty"` // The VM the backup belongs to.
}

type FindRequest

type FindRequest struct {
	Node    string `url:"node",json:"node"`       // The cluster node name.
	Storage string `url:"storage",json:"storage"` // The storage identifier.

}

type FindResponse

type FindResponse []*struct {
	Subdir string `url:"subdir",json:"subdir"`
}

type HTTPClient

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

type IndexRequest

type IndexRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.

	// The following parameters are optional
	Content *string `url:"content,omitempty",json:"content,omitempty"` // Only list stores which support this content type.
	Enabled *bool   `url:"enabled,omitempty",json:"enabled,omitempty"` // Only list stores which are enabled (not disabled in config).
	Format  *bool   `url:"format,omitempty",json:"format,omitempty"`   // Include information about formats
	Storage *string `url:"storage,omitempty",json:"storage,omitempty"` // Only list status for  specified storage
	Target  *string `url:"target,omitempty",json:"target,omitempty"`   // If target is different to 'node', we only lists shared storages which content is accessible on this 'node' and the specified 'target' node.
}

type IndexResponse

type IndexResponse []*struct {
	Content string `url:"content",json:"content"` // Allowed storage content types.
	Storage string `url:"storage",json:"storage"` // The storage identifier.
	Type    string `url:"type",json:"type"`       // Storage type.

	// The following parameters are optional
	Active       *bool    `url:"active,omitempty",json:"active,omitempty"`               // Set when storage is accessible.
	Avail        *int     `url:"avail,omitempty",json:"avail,omitempty"`                 // Available storage space in bytes.
	Enabled      *bool    `url:"enabled,omitempty",json:"enabled,omitempty"`             // Set when storage is enabled (not disabled).
	Shared       *bool    `url:"shared,omitempty",json:"shared,omitempty"`               // Shared flag from storage configuration.
	Total        *int     `url:"total,omitempty",json:"total,omitempty"`                 // Total storage space in bytes.
	Used         *int     `url:"used,omitempty",json:"used,omitempty"`                   // Used storage space in bytes.
	UsedFraction *float64 `url:"used_fraction,omitempty",json:"used_fraction,omitempty"` // Used fraction (used/total).
}

type ReadStatusRequest

type ReadStatusRequest struct {
	Node    string `url:"node",json:"node"`       // The cluster node name.
	Storage string `url:"storage",json:"storage"` // The storage identifier.

}

type ReadStatusResponse

type ReadStatusResponse map[string]interface{}

type RrdRequest

type RrdRequest struct {
	Ds        string `url:"ds",json:"ds"`               // The list of datasources you want to display.
	Node      string `url:"node",json:"node"`           // The cluster node name.
	Storage   string `url:"storage",json:"storage"`     // The storage identifier.
	Timeframe string `url:"timeframe",json:"timeframe"` // Specify the time frame you are interested in.

	// The following parameters are optional
	Cf *string `url:"cf,omitempty",json:"cf,omitempty"` // The RRD consolidation function
}

type RrdResponse

type RrdResponse struct {
	Filename string `url:"filename",json:"filename"`
}

type RrddataRequest

type RrddataRequest struct {
	Node      string `url:"node",json:"node"`           // The cluster node name.
	Storage   string `url:"storage",json:"storage"`     // The storage identifier.
	Timeframe string `url:"timeframe",json:"timeframe"` // Specify the time frame you are interested in.

	// The following parameters are optional
	Cf *string `url:"cf,omitempty",json:"cf,omitempty"` // The RRD consolidation function
}

type RrddataResponse

type RrddataResponse []*map[string]interface{}

type UploadRequest

type UploadRequest struct {
	Content  string `url:"content",json:"content"`   // Content type.
	Filename string `url:"filename",json:"filename"` // The name of the file to create. Caution: This will be normalized!
	Node     string `url:"node",json:"node"`         // The cluster node name.
	Storage  string `url:"storage",json:"storage"`   // The storage identifier.

	// The following parameters are optional
	Checksum          *string `url:"checksum,omitempty",json:"checksum,omitempty"`                     // The expected checksum of the file.
	ChecksumAlgorithm *string `url:"checksum-algorithm,omitempty",json:"checksum-algorithm,omitempty"` // The algorithm to calculate the checksum of the file.
	Tmpfilename       *string `url:"tmpfilename,omitempty",json:"tmpfilename,omitempty"`               // The source file name. This parameter is usually set by the REST handler. You can only overwrite it when connecting to the trusted port on localhost.
}

type UploadResponse

type UploadResponse string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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