Documentation ¶
Index ¶
- type Client
- func (c *Client) APIUpload(ctx context.Context, d *api.FileUploadRequest, tempDir string) (*DatastoreUploadResponseBody, error)
- func (c *Client) DeleteDatastoreFile(ctx context.Context, volumeID string) error
- func (c *Client) DownloadFileByURL(ctx context.Context, d *DownloadURLPostRequestBody) error
- func (c *Client) ExpandPath(path string) string
- func (c *Client) GetDatastoreFile(ctx context.Context, volumeID string) (*DatastoreFileGetResponseData, error)
- func (c *Client) GetDatastoreStatus(ctx context.Context) (*DatastoreGetStatusResponseData, error)
- func (c *Client) ListDatastoreFiles(ctx context.Context) ([]*DatastoreFileListResponseData, error)
- func (c *Client) ListDatastores(ctx context.Context, d *DatastoreListRequestBody) ([]*DatastoreListResponseData, error)
- func (c *Client) Tasks() *tasks.Client
- type DatastoreFileGetRequestData
- type DatastoreFileGetResponseBody
- type DatastoreFileGetResponseData
- type DatastoreFileListResponseBody
- type DatastoreFileListResponseData
- type DatastoreGetStatusResponseBody
- type DatastoreGetStatusResponseData
- type DatastoreListRequestBody
- type DatastoreListResponseBody
- type DatastoreListResponseData
- type DatastoreUploadResponseBody
- type DownloadURLPostRequestBody
- type DownloadURLResponseBody
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 node storage API.
func (*Client) APIUpload ¶
func (c *Client) APIUpload( ctx context.Context, d *api.FileUploadRequest, tempDir string, ) (*DatastoreUploadResponseBody, error)
APIUpload uploads a file to a datastore using the Proxmox API.
func (*Client) DeleteDatastoreFile ¶
DeleteDatastoreFile deletes a file in a datastore.
func (*Client) DownloadFileByURL ¶
func (c *Client) DownloadFileByURL( ctx context.Context, d *DownloadURLPostRequestBody, ) error
DownloadFileByURL downloads the file using URL.
func (*Client) ExpandPath ¶
ExpandPath expands a relative path to a full node storage API path.
func (*Client) GetDatastoreFile ¶
func (c *Client) GetDatastoreFile( ctx context.Context, volumeID string, ) (*DatastoreFileGetResponseData, error)
GetDatastoreFile get a file details in a datastore.
func (*Client) GetDatastoreStatus ¶
func (c *Client) GetDatastoreStatus( ctx context.Context, ) (*DatastoreGetStatusResponseData, error)
GetDatastoreStatus gets status information for a given datastore.
func (*Client) ListDatastoreFiles ¶
func (c *Client) ListDatastoreFiles( ctx context.Context, ) ([]*DatastoreFileListResponseData, error)
ListDatastoreFiles retrieves a list of the files in a datastore.
func (*Client) ListDatastores ¶
func (c *Client) ListDatastores( ctx context.Context, d *DatastoreListRequestBody, ) ([]*DatastoreListResponseData, error)
ListDatastores retrieves a list of nodes.
type DatastoreFileGetRequestData ¶
type DatastoreFileGetRequestData struct { Node string `json:"node,omitempty" url:"node,omitempty"` VolumeID string `json:"volume,omitempty" url:"volume,omitempty"` }
DatastoreFileGetRequestData contains the body from a datastore content get request.
type DatastoreFileGetResponseBody ¶
type DatastoreFileGetResponseBody struct {
Data *DatastoreFileGetResponseData `json:"data,omitempty" url:"data,omitempty"`
}
DatastoreFileGetResponseBody contains the body from a datastore content get response.
type DatastoreFileGetResponseData ¶
type DatastoreFileGetResponseData struct { Path *string `json:"path" url:"path,omitempty"` FileFormat *string `json:"format" url:"format,omitempty"` FileSize *int64 `json:"size" url:"size,omitempty"` SpaceUsed *int64 `json:"used,omitempty" url:"used,omitempty"` }
DatastoreFileGetResponseData contains the data from a datastore content get response.
type DatastoreFileListResponseBody ¶
type DatastoreFileListResponseBody struct {
Data []*DatastoreFileListResponseData `json:"data,omitempty"`
}
DatastoreFileListResponseBody contains the body from a datastore content list response.
type DatastoreFileListResponseData ¶
type DatastoreFileListResponseData struct { ContentType string `json:"content"` FileFormat string `json:"format"` FileSize int64 `json:"size"` ParentVolumeID *string `json:"parent,omitempty"` SpaceUsed *int `json:"used,omitempty"` VMID *int `json:"vmid,omitempty"` VolumeID string `json:"volid"` }
DatastoreFileListResponseData contains the data from a datastore content list response.
type DatastoreGetStatusResponseBody ¶
type DatastoreGetStatusResponseBody struct {
Data *DatastoreGetStatusResponseData `json:"data,omitempty"`
}
DatastoreGetStatusResponseBody contains the body from a datastore status get request.
type DatastoreGetStatusResponseData ¶
type DatastoreGetStatusResponseData struct { Active *types.CustomBool `json:"active,omitempty"` AvailableBytes *int64 `json:"avail,omitempty"` Content *types.CustomCommaSeparatedList `json:"content,omitempty" url:"content,omitempty,comma"` Enabled *types.CustomBool `json:"enabled,omitempty"` TotalBytes *int64 `json:"total,omitempty"` Type *string `json:"type,omitempty"` UsedBytes *int64 `json:"used,omitempty"` }
DatastoreGetStatusResponseData contains the data from a datastore status get request.
type DatastoreListRequestBody ¶
type DatastoreListRequestBody struct { ContentTypes types.CustomCommaSeparatedList `json:"content,omitempty" url:"content,omitempty,comma"` Enabled *types.CustomBool `json:"enabled,omitempty" url:"enabled,omitempty,int"` Format *types.CustomBool `json:"format,omitempty" url:"format,omitempty,int"` ID *string `json:"storage,omitempty" url:"storage,omitempty"` Target *string `json:"target,omitempty" url:"target,omitempty"` }
DatastoreListRequestBody contains the body for a datastore list request.
type DatastoreListResponseBody ¶
type DatastoreListResponseBody struct {
Data []*DatastoreListResponseData `json:"data,omitempty"`
}
DatastoreListResponseBody contains the body from a datastore list response.
type DatastoreListResponseData ¶
type DatastoreListResponseData struct { Active *types.CustomBool `json:"active,omitempty"` ContentTypes *types.CustomCommaSeparatedList `json:"content,omitempty"` Enabled *types.CustomBool `json:"enabled,omitempty"` ID string `json:"storage,omitempty"` SpaceAvailable *int `json:"avail,omitempty"` SpaceTotal *int `json:"total,omitempty"` SpaceUsed *int `json:"used,omitempty"` SpaceUsedPercentage *float64 `json:"used_fraction,omitempty"` Type string `json:"type,omitempty"` }
DatastoreListResponseData contains the data from a datastore list response.
type DatastoreUploadResponseBody ¶
type DatastoreUploadResponseBody struct {
UploadID *string `json:"data,omitempty"`
}
DatastoreUploadResponseBody contains the body from a datastore upload response.
type DownloadURLPostRequestBody ¶
type DownloadURLPostRequestBody struct { Content *string `json:"content,omitempty" url:"content,omitempty"` FileName *string `json:"filename,omitempty" url:"filename,omitempty"` Node *string `json:"node,omitempty" url:"node,omitempty"` Storage *string `json:"storage,omitempty" url:"storage,omitempty"` URL *string `json:"url,omitempty" url:"url,omitempty"` Checksum *string `json:"checksum,omitempty" url:"checksum,omitempty"` ChecksumAlgorithm *string `json:"checksum-algorithm,omitempty" url:"checksum-algorithm,omitempty"` Compression *string `json:"compression,omitempty" url:"compression,omitempty"` Verify *types.CustomBool `json:"verify-certificates,omitempty" url:"verify-certificates,omitempty,int"` }
DownloadURLPostRequestBody contains the body for a DownloadURL post request.
type DownloadURLResponseBody ¶
type DownloadURLResponseBody struct {
TaskID *string `json:"data,omitempty"`
}
DownloadURLResponseBody contains the body from a DownloadURL post response.