From 52b6b031a54dbd909c63471515f70e39d6075942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 26 Aug 2024 01:03:15 -0400 Subject: [PATCH 1/7] shared/api: Fix incorrect struct naming for volume backups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- shared/api/storage_pool_volume_backup.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/api/storage_pool_volume_backup.go b/shared/api/storage_pool_volume_backup.go index 066ae89f447..397f861af52 100644 --- a/shared/api/storage_pool_volume_backup.go +++ b/shared/api/storage_pool_volume_backup.go @@ -4,12 +4,12 @@ import ( "time" ) -// StoragePoolVolumeBackup represents a volume backup +// StorageVolumeBackup represents a volume backup // // swagger:model // // API extension: custom_volume_backup. -type StoragePoolVolumeBackup struct { +type StorageVolumeBackup struct { // Backup name // Example: backup0 Name string `json:"name" yaml:"name"` @@ -31,12 +31,12 @@ type StoragePoolVolumeBackup struct { OptimizedStorage bool `json:"optimized_storage" yaml:"optimized_storage"` } -// StoragePoolVolumeBackupsPost represents the fields available for a new volume backup +// StorageVolumeBackupsPost represents the fields available for a new volume backup // // swagger:model // // API extension: custom_volume_backup. -type StoragePoolVolumeBackupsPost struct { +type StorageVolumeBackupsPost struct { // Backup name // Example: backup0 Name string `json:"name" yaml:"name"` @@ -58,12 +58,12 @@ type StoragePoolVolumeBackupsPost struct { CompressionAlgorithm string `json:"compression_algorithm" yaml:"compression_algorithm"` } -// StoragePoolVolumeBackupPost represents the fields available for the renaming of a volume backup +// StorageVolumeBackupPost represents the fields available for the renaming of a volume backup // // swagger:model // // API extension: custom_volume_backup. -type StoragePoolVolumeBackupPost struct { +type StorageVolumeBackupPost struct { // New backup name // Example: backup1 Name string `json:"name" yaml:"name"` From 9eb5f8404a835798d28e679f1c36fc93384c6140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 26 Aug 2024 01:03:42 -0400 Subject: [PATCH 2/7] client: Update for fixed volume backup structs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- client/incus_storage_volumes.go | 36 ++++++++++++++++----------------- client/interfaces.go | 22 ++++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/client/incus_storage_volumes.go b/client/incus_storage_volumes.go index be89a4fa9cd..7bca70304ac 100644 --- a/client/incus_storage_volumes.go +++ b/client/incus_storage_volumes.go @@ -814,8 +814,8 @@ func (r *ProtocolIncus) RenameStoragePoolVolume(pool string, volType string, nam return nil } -// GetStoragePoolVolumeBackupNames returns a list of volume backup names. -func (r *ProtocolIncus) GetStoragePoolVolumeBackupNames(pool string, volName string) ([]string, error) { +// GetStorageVolumeBackupNames returns a list of volume backup names. +func (r *ProtocolIncus) GetStorageVolumeBackupNames(pool string, volName string) ([]string, error) { if !r.HasExtension("custom_volume_backup") { return nil, fmt.Errorf("The server is missing the required \"custom_volume_backup\" API extension") } @@ -832,14 +832,14 @@ func (r *ProtocolIncus) GetStoragePoolVolumeBackupNames(pool string, volName str return urlsToResourceNames(baseURL, urls...) } -// GetStoragePoolVolumeBackups returns a list of custom volume backups. -func (r *ProtocolIncus) GetStoragePoolVolumeBackups(pool string, volName string) ([]api.StoragePoolVolumeBackup, error) { +// GetStorageVolumeBackups returns a list of custom volume backups. +func (r *ProtocolIncus) GetStorageVolumeBackups(pool string, volName string) ([]api.StorageVolumeBackup, error) { if !r.HasExtension("custom_volume_backup") { return nil, fmt.Errorf("The server is missing the required \"custom_volume_backup\" API extension") } // Fetch the raw value - backups := []api.StoragePoolVolumeBackup{} + backups := []api.StorageVolumeBackup{} _, err := r.queryStruct("GET", fmt.Sprintf("/storage-pools/%s/volumes/custom/%s/backups?recursion=1", url.PathEscape(pool), url.PathEscape(volName)), nil, "", &backups) if err != nil { @@ -849,14 +849,14 @@ func (r *ProtocolIncus) GetStoragePoolVolumeBackups(pool string, volName string) return backups, nil } -// GetStoragePoolVolumeBackup returns a custom volume backup. -func (r *ProtocolIncus) GetStoragePoolVolumeBackup(pool string, volName string, name string) (*api.StoragePoolVolumeBackup, string, error) { +// GetStorageVolumeBackup returns a custom volume backup. +func (r *ProtocolIncus) GetStorageVolumeBackup(pool string, volName string, name string) (*api.StorageVolumeBackup, string, error) { if !r.HasExtension("custom_volume_backup") { return nil, "", fmt.Errorf("The server is missing the required \"custom_volume_backup\" API extension") } // Fetch the raw value - backup := api.StoragePoolVolumeBackup{} + backup := api.StorageVolumeBackup{} etag, err := r.queryStruct("GET", fmt.Sprintf("/storage-pools/%s/volumes/custom/%s/backups/%s", url.PathEscape(pool), url.PathEscape(volName), url.PathEscape(name)), nil, "", &backup) if err != nil { return nil, "", err @@ -865,8 +865,8 @@ func (r *ProtocolIncus) GetStoragePoolVolumeBackup(pool string, volName string, return &backup, etag, nil } -// CreateStoragePoolVolumeBackup creates new custom volume backup. -func (r *ProtocolIncus) CreateStoragePoolVolumeBackup(pool string, volName string, backup api.StoragePoolVolumeBackupsPost) (Operation, error) { +// CreateStorageVolumeBackup creates new custom volume backup. +func (r *ProtocolIncus) CreateStorageVolumeBackup(pool string, volName string, backup api.StorageVolumeBackupsPost) (Operation, error) { if !r.HasExtension("custom_volume_backup") { return nil, fmt.Errorf("The server is missing the required \"custom_volume_backup\" API extension") } @@ -880,8 +880,8 @@ func (r *ProtocolIncus) CreateStoragePoolVolumeBackup(pool string, volName strin return op, nil } -// RenameStoragePoolVolumeBackup renames a custom volume backup. -func (r *ProtocolIncus) RenameStoragePoolVolumeBackup(pool string, volName string, name string, backup api.StoragePoolVolumeBackupPost) (Operation, error) { +// RenameStorageVolumeBackup renames a custom volume backup. +func (r *ProtocolIncus) RenameStorageVolumeBackup(pool string, volName string, name string, backup api.StorageVolumeBackupPost) (Operation, error) { if !r.HasExtension("custom_volume_backup") { return nil, fmt.Errorf("The server is missing the required \"custom_volume_backup\" API extension") } @@ -895,8 +895,8 @@ func (r *ProtocolIncus) RenameStoragePoolVolumeBackup(pool string, volName strin return op, nil } -// DeleteStoragePoolVolumeBackup deletes a custom volume backup. -func (r *ProtocolIncus) DeleteStoragePoolVolumeBackup(pool string, volName string, name string) (Operation, error) { +// DeleteStorageVolumeBackup deletes a custom volume backup. +func (r *ProtocolIncus) DeleteStorageVolumeBackup(pool string, volName string, name string) (Operation, error) { if !r.HasExtension("custom_volume_backup") { return nil, fmt.Errorf("The server is missing the required \"custom_volume_backup\" API extension") } @@ -910,8 +910,8 @@ func (r *ProtocolIncus) DeleteStoragePoolVolumeBackup(pool string, volName strin return op, nil } -// GetStoragePoolVolumeBackupFile requests the custom volume backup content. -func (r *ProtocolIncus) GetStoragePoolVolumeBackupFile(pool string, volName string, name string, req *BackupFileRequest) (*BackupFileResponse, error) { +// GetStorageVolumeBackupFile requests the custom volume backup content. +func (r *ProtocolIncus) GetStorageVolumeBackupFile(pool string, volName string, name string, req *BackupFileRequest) (*BackupFileResponse, error) { if !r.HasExtension("custom_volume_backup") { return nil, fmt.Errorf("The server is missing the required \"custom_volume_backup\" API extension") } @@ -977,7 +977,7 @@ func (r *ProtocolIncus) GetStoragePoolVolumeBackupFile(pool string, volName stri } // CreateStoragePoolVolumeFromISO creates a custom volume from an ISO file. -func (r *ProtocolIncus) CreateStoragePoolVolumeFromISO(pool string, args StoragePoolVolumeBackupArgs) (Operation, error) { +func (r *ProtocolIncus) CreateStoragePoolVolumeFromISO(pool string, args StorageVolumeBackupArgs) (Operation, error) { err := r.CheckExtension("custom_volume_iso") if err != nil { return nil, err @@ -1035,7 +1035,7 @@ func (r *ProtocolIncus) CreateStoragePoolVolumeFromISO(pool string, args Storage } // CreateStoragePoolVolumeFromBackup creates a custom volume from a backup file. -func (r *ProtocolIncus) CreateStoragePoolVolumeFromBackup(pool string, args StoragePoolVolumeBackupArgs) (Operation, error) { +func (r *ProtocolIncus) CreateStoragePoolVolumeFromBackup(pool string, args StorageVolumeBackupArgs) (Operation, error) { if !r.HasExtension("custom_volume_backup") { return nil, fmt.Errorf(`The server is missing the required "custom_volume_backup" API extension`) } diff --git a/client/interfaces.go b/client/interfaces.go index 38f15f1f8dc..7cdf1bf1fb8 100644 --- a/client/interfaces.go +++ b/client/interfaces.go @@ -353,17 +353,17 @@ type InstanceServer interface { UpdateStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string, volume api.StorageVolumeSnapshotPut, ETag string) (err error) // Storage volume backup functions ("custom_volume_backup" API extension) - GetStoragePoolVolumeBackupNames(pool string, volName string) (names []string, err error) - GetStoragePoolVolumeBackups(pool string, volName string) (backups []api.StoragePoolVolumeBackup, err error) - GetStoragePoolVolumeBackup(pool string, volName string, name string) (backup *api.StoragePoolVolumeBackup, ETag string, err error) - CreateStoragePoolVolumeBackup(pool string, volName string, backup api.StoragePoolVolumeBackupsPost) (op Operation, err error) - RenameStoragePoolVolumeBackup(pool string, volName string, name string, backup api.StoragePoolVolumeBackupPost) (op Operation, err error) - DeleteStoragePoolVolumeBackup(pool string, volName string, name string) (op Operation, err error) - GetStoragePoolVolumeBackupFile(pool string, volName string, name string, req *BackupFileRequest) (resp *BackupFileResponse, err error) - CreateStoragePoolVolumeFromBackup(pool string, args StoragePoolVolumeBackupArgs) (op Operation, err error) + GetStorageVolumeBackupNames(pool string, volName string) (names []string, err error) + GetStorageVolumeBackups(pool string, volName string) (backups []api.StorageVolumeBackup, err error) + GetStorageVolumeBackup(pool string, volName string, name string) (backup *api.StorageVolumeBackup, ETag string, err error) + CreateStorageVolumeBackup(pool string, volName string, backup api.StorageVolumeBackupsPost) (op Operation, err error) + RenameStorageVolumeBackup(pool string, volName string, name string, backup api.StorageVolumeBackupPost) (op Operation, err error) + DeleteStorageVolumeBackup(pool string, volName string, name string) (op Operation, err error) + GetStorageVolumeBackupFile(pool string, volName string, name string, req *BackupFileRequest) (resp *BackupFileResponse, err error) + CreateStoragePoolVolumeFromBackup(pool string, args StorageVolumeBackupArgs) (op Operation, err error) // Storage volume ISO import function ("custom_volume_iso" API extension) - CreateStoragePoolVolumeFromISO(pool string, args StoragePoolVolumeBackupArgs) (op Operation, err error) + CreateStoragePoolVolumeFromISO(pool string, args StorageVolumeBackupArgs) (op Operation, err error) // Cluster functions ("cluster" API extensions) GetCluster() (cluster *api.Cluster, ETag string, err error) @@ -532,9 +532,9 @@ type StoragePoolVolumeMoveArgs struct { Project string } -// The StoragePoolVolumeBackupArgs struct is used when creating a storage volume from a backup. +// The StorageVolumeBackupArgs struct is used when creating a storage volume from a backup. // API extension: custom_volume_backup. -type StoragePoolVolumeBackupArgs struct { +type StorageVolumeBackupArgs struct { // The backup file BackupFile io.Reader From 6b54848bd6932ae93e5ecd77a7060104c7e3425e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 26 Aug 2024 01:03:57 -0400 Subject: [PATCH 3/7] incus: Update for fixed volume backup structs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incus/storage_volume.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/incus/storage_volume.go b/cmd/incus/storage_volume.go index e04cc79734a..b3d5ca24ba3 100644 --- a/cmd/incus/storage_volume.go +++ b/cmd/incus/storage_volume.go @@ -1402,9 +1402,9 @@ func (c *cmdStorageVolumeInfo) Run(cmd *cobra.Command, args []string) error { return err } - var volBackups []api.StoragePoolVolumeBackup + var volBackups []api.StorageVolumeBackup if client.HasExtension("custom_volume_backup") && volType == "custom" { - volBackups, err = client.GetStoragePoolVolumeBackups(resource.name, volName) + volBackups, err = client.GetStorageVolumeBackups(resource.name, volName) if err != nil { return err } @@ -2976,7 +2976,7 @@ func (c *cmdStorageVolumeExport) Run(cmd *cobra.Command, args []string) error { return fmt.Errorf(i18n.G("Only \"custom\" volumes can be exported")) } - req := api.StoragePoolVolumeBackupsPost{ + req := api.StorageVolumeBackupsPost{ Name: "", ExpiresAt: time.Now().Add(24 * time.Hour), VolumeOnly: volumeOnly, @@ -2984,7 +2984,7 @@ func (c *cmdStorageVolumeExport) Run(cmd *cobra.Command, args []string) error { CompressionAlgorithm: c.flagCompressionAlgorithm, } - op, err := d.CreateStoragePoolVolumeBackup(name, volName, req) + op, err := d.CreateStorageVolumeBackup(name, volName, req) if err != nil { return fmt.Errorf(i18n.G("Failed to create storage volume backup: %w"), err) } @@ -3029,7 +3029,7 @@ func (c *cmdStorageVolumeExport) Run(cmd *cobra.Command, args []string) error { defer func() { // Delete backup after we're done - op, err = d.DeleteStoragePoolVolumeBackup(name, volName, backupName) + op, err = d.DeleteStorageVolumeBackup(name, volName, backupName) if err == nil { _ = op.Wait() } @@ -3061,7 +3061,7 @@ func (c *cmdStorageVolumeExport) Run(cmd *cobra.Command, args []string) error { } // Export tarball - _, err = d.GetStoragePoolVolumeBackupFile(name, volName, backupName, &backupFileRequest) + _, err = d.GetStorageVolumeBackupFile(name, volName, backupName, &backupFileRequest) if err != nil { _ = os.Remove(targetName) progress.Done("") @@ -3172,7 +3172,7 @@ func (c *cmdStorageVolumeImport) Run(cmd *cobra.Command, args []string) error { Quiet: c.global.flagQuiet, } - createArgs := incus.StoragePoolVolumeBackupArgs{ + createArgs := incus.StorageVolumeBackupArgs{ BackupFile: &ioprogress.ProgressReader{ ReadCloser: file, Tracker: &ioprogress.ProgressTracker{ From 52058f28dced02902b6eb01a4816d5345167e13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 26 Aug 2024 01:06:06 -0400 Subject: [PATCH 4/7] incusd: Update for fixed volume backup structs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incusd/storage_volumes_backup.go | 6 +++--- internal/server/backup/backup_volume.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/incusd/storage_volumes_backup.go b/cmd/incusd/storage_volumes_backup.go index 6cc8b3952e1..28f7c338db8 100644 --- a/cmd/incusd/storage_volumes_backup.go +++ b/cmd/incusd/storage_volumes_backup.go @@ -228,7 +228,7 @@ func storagePoolVolumeTypeCustomBackupsGet(d *Daemon, r *http.Request) response. } resultString := []string{} - resultMap := []*api.StoragePoolVolumeBackup{} + resultMap := []*api.StorageVolumeBackup{} for _, backup := range backups { if !recursion { @@ -379,7 +379,7 @@ func storagePoolVolumeTypeCustomBackupsPost(d *Daemon, r *http.Request) response return response.InternalError(err) } - req := api.StoragePoolVolumeBackupsPost{} + req := api.StorageVolumeBackupsPost{} err = json.Unmarshal(body, &req) if err != nil { @@ -662,7 +662,7 @@ func storagePoolVolumeTypeCustomBackupPost(d *Daemon, r *http.Request) response. return resp } - req := api.StoragePoolVolumeBackupPost{} + req := api.StorageVolumeBackupPost{} err = json.NewDecoder(r.Body).Decode(&req) if err != nil { return response.BadRequest(err) diff --git a/internal/server/backup/backup_volume.go b/internal/server/backup/backup_volume.go index 86e15e7d36c..1fdeded5216 100644 --- a/internal/server/backup/backup_volume.go +++ b/internal/server/backup/backup_volume.go @@ -139,8 +139,8 @@ func (b *VolumeBackup) Delete() error { } // Render returns a VolumeBackup struct of the backup. -func (b *VolumeBackup) Render() *api.StoragePoolVolumeBackup { - return &api.StoragePoolVolumeBackup{ +func (b *VolumeBackup) Render() *api.StorageVolumeBackup { + return &api.StorageVolumeBackup{ Name: strings.SplitN(b.name, "/", 2)[1], CreatedAt: b.creationDate, ExpiresAt: b.expiryDate, From 118a281e87f1b618a9c25d8586fdec4c36ad0d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 26 Aug 2024 01:07:02 -0400 Subject: [PATCH 5/7] incusd/storage_volume_backup: Fix swagger references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incusd/storage_volumes_backup.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/incusd/storage_volumes_backup.go b/cmd/incusd/storage_volumes_backup.go index 28f7c338db8..ec5c9a9a66d 100644 --- a/cmd/incusd/storage_volumes_backup.go +++ b/cmd/incusd/storage_volumes_backup.go @@ -148,7 +148,7 @@ var storagePoolVolumeTypeCustomBackupExportCmd = APIEndpoint{ // type: array // description: List of storage volume backups // items: -// $ref: "#/definitions/StoragePoolVolumeBackup" +// $ref: "#/definitions/StorageVolumeBackup" // "403": // $ref: "#/responses/Forbidden" // "500": @@ -274,7 +274,7 @@ func storagePoolVolumeTypeCustomBackupsGet(d *Daemon, r *http.Request) response. // description: Storage volume backup // required: true // schema: -// $ref: "#/definitions/StoragePoolVolumeBackupsPost" +// $ref: "#/definitions/StorageVolumeBackupsPost" // responses: // "202": // $ref: "#/responses/Operation" @@ -504,7 +504,7 @@ func storagePoolVolumeTypeCustomBackupsPost(d *Daemon, r *http.Request) response // description: Status code // example: 200 // metadata: -// $ref: "#/definitions/StoragePoolVolumeBackup" +// $ref: "#/definitions/StorageVolumeBackup" // "403": // $ref: "#/responses/Forbidden" // "500": From edd03c4551acab3ee66780e43634091ef8f424af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 26 Aug 2024 01:07:25 -0400 Subject: [PATCH 6/7] incusd/storage_bucket_backup: Fix swagger references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1154 Signed-off-by: Stéphane Graber --- cmd/incusd/storage_buckets_backup.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/incusd/storage_buckets_backup.go b/cmd/incusd/storage_buckets_backup.go index 8e2599d8f35..bc81037bc5c 100644 --- a/cmd/incusd/storage_buckets_backup.go +++ b/cmd/incusd/storage_buckets_backup.go @@ -147,7 +147,7 @@ var storagePoolBucketBackupsExportCmd = APIEndpoint{ // type: array // description: List of storage bucket backups // items: -// $ref: "#/definitions/StoragePoolBucketBackup" +// $ref: "#/definitions/StorageBucketBackup" // "403": // $ref: "#/responses/Forbidden" // "500": @@ -231,7 +231,7 @@ func storagePoolBucketBackupsGet(d *Daemon, r *http.Request) response.Response { // description: Storage bucket backup // required: true // schema: -// $ref: "#/definitions/StoragePoolBucketBackupsPost" +// $ref: "#/definitions/StorageBucketBackupsPost" // responses: // "202": // $ref: "#/responses/Operation" @@ -431,7 +431,7 @@ func storagePoolBucketBackupsPost(d *Daemon, r *http.Request) response.Response // description: Status code // example: 200 // metadata: -// $ref: "#/definitions/StoragePoolBucketBackup" +// $ref: "#/definitions/StorageBucketBackup" // "403": // $ref: "#/responses/Forbidden" // "500": From 55079abe2b290a8c9d9c6c90e9840b99c7c5f9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 26 Aug 2024 01:08:22 -0400 Subject: [PATCH 7/7] doc/rest-api: Refresh swagger YAML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- doc/rest-api.yaml | 158 +++++++++++++++++++++++----------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/doc/rest-api.yaml b/doc/rest-api.yaml index ba24d4c571b..40f596cb56a 100644 --- a/doc/rest-api.yaml +++ b/doc/rest-api.yaml @@ -6055,79 +6055,6 @@ definitions: title: StoragePoolState represents the state of a storage pool. type: object x-go-package: github.com/lxc/incus/v6/shared/api - StoragePoolVolumeBackup: - description: StoragePoolVolumeBackup represents a volume backup - properties: - created_at: - description: When the backup was created - example: "2021-03-23T16:38:37.753398689-04:00" - format: date-time - type: string - x-go-name: CreatedAt - expires_at: - description: When the backup expires (gets auto-deleted) - example: "2021-03-23T17:38:37.753398689-04:00" - format: date-time - type: string - x-go-name: ExpiresAt - name: - description: Backup name - example: backup0 - type: string - x-go-name: Name - optimized_storage: - description: Whether to use a pool-optimized binary format (instead of plain tarball) - example: true - type: boolean - x-go-name: OptimizedStorage - volume_only: - description: Whether to ignore snapshots - example: false - type: boolean - x-go-name: VolumeOnly - type: object - x-go-package: github.com/lxc/incus/v6/shared/api - StoragePoolVolumeBackupPost: - description: StoragePoolVolumeBackupPost represents the fields available for the renaming of a volume backup - properties: - name: - description: New backup name - example: backup1 - type: string - x-go-name: Name - type: object - x-go-package: github.com/lxc/incus/v6/shared/api - StoragePoolVolumeBackupsPost: - description: StoragePoolVolumeBackupsPost represents the fields available for a new volume backup - properties: - compression_algorithm: - description: What compression algorithm to use - example: gzip - type: string - x-go-name: CompressionAlgorithm - expires_at: - description: When the backup expires (gets auto-deleted) - example: "2021-03-23T17:38:37.753398689-04:00" - format: date-time - type: string - x-go-name: ExpiresAt - name: - description: Backup name - example: backup0 - type: string - x-go-name: Name - optimized_storage: - description: Whether to use a pool-optimized binary format (instead of plain tarball) - example: true - type: boolean - x-go-name: OptimizedStorage - volume_only: - description: Whether to ignore snapshots - example: false - type: boolean - x-go-name: VolumeOnly - type: object - x-go-package: github.com/lxc/incus/v6/shared/api StoragePoolsPost: description: StoragePoolsPost represents the fields of a new storage pool properties: @@ -6220,6 +6147,79 @@ definitions: title: StorageVolume represents the fields of a storage volume. type: object x-go-package: github.com/lxc/incus/v6/shared/api + StorageVolumeBackup: + description: StorageVolumeBackup represents a volume backup + properties: + created_at: + description: When the backup was created + example: "2021-03-23T16:38:37.753398689-04:00" + format: date-time + type: string + x-go-name: CreatedAt + expires_at: + description: When the backup expires (gets auto-deleted) + example: "2021-03-23T17:38:37.753398689-04:00" + format: date-time + type: string + x-go-name: ExpiresAt + name: + description: Backup name + example: backup0 + type: string + x-go-name: Name + optimized_storage: + description: Whether to use a pool-optimized binary format (instead of plain tarball) + example: true + type: boolean + x-go-name: OptimizedStorage + volume_only: + description: Whether to ignore snapshots + example: false + type: boolean + x-go-name: VolumeOnly + type: object + x-go-package: github.com/lxc/incus/v6/shared/api + StorageVolumeBackupPost: + description: StorageVolumeBackupPost represents the fields available for the renaming of a volume backup + properties: + name: + description: New backup name + example: backup1 + type: string + x-go-name: Name + type: object + x-go-package: github.com/lxc/incus/v6/shared/api + StorageVolumeBackupsPost: + description: StorageVolumeBackupsPost represents the fields available for a new volume backup + properties: + compression_algorithm: + description: What compression algorithm to use + example: gzip + type: string + x-go-name: CompressionAlgorithm + expires_at: + description: When the backup expires (gets auto-deleted) + example: "2021-03-23T17:38:37.753398689-04:00" + format: date-time + type: string + x-go-name: ExpiresAt + name: + description: Backup name + example: backup0 + type: string + x-go-name: Name + optimized_storage: + description: Whether to use a pool-optimized binary format (instead of plain tarball) + example: true + type: boolean + x-go-name: OptimizedStorage + volume_only: + description: Whether to ignore snapshots + example: false + type: boolean + x-go-name: VolumeOnly + type: object + x-go-package: github.com/lxc/incus/v6/shared/api StorageVolumePost: description: StorageVolumePost represents the fields required to rename a storage pool volume properties: @@ -14380,7 +14380,7 @@ paths: name: bucket required: true schema: - $ref: '#/definitions/StoragePoolBucketBackupsPost' + $ref: '#/definitions/StorageBucketBackupsPost' produces: - application/json responses: @@ -14449,7 +14449,7 @@ paths: description: Sync response properties: metadata: - $ref: '#/definitions/StoragePoolBucketBackup' + $ref: '#/definitions/StorageBucketBackup' status: description: Status description example: Success @@ -14559,7 +14559,7 @@ paths: metadata: description: List of storage bucket backups items: - $ref: '#/definitions/StoragePoolBucketBackup' + $ref: '#/definitions/StorageBucketBackup' type: array status: description: Status description @@ -15249,7 +15249,7 @@ paths: name: volume required: true schema: - $ref: '#/definitions/StoragePoolVolumeBackupsPost' + $ref: '#/definitions/StorageVolumeBackupsPost' produces: - application/json responses: @@ -15318,7 +15318,7 @@ paths: description: Sync response properties: metadata: - $ref: '#/definitions/StoragePoolVolumeBackup' + $ref: '#/definitions/StorageVolumeBackup' status: description: Status description example: Success @@ -15428,7 +15428,7 @@ paths: metadata: description: List of storage volume backups items: - $ref: '#/definitions/StoragePoolVolumeBackup' + $ref: '#/definitions/StorageVolumeBackup' type: array status: description: Status description