@@ -314,6 +314,29 @@ func (enum *VolumeStatus) UnmarshalJSON(data []byte) error {
314
314
return nil
315
315
}
316
316
317
+ // Reference: reference.
318
+ type Reference struct {
319
+ // ID: UUID of the reference.
320
+ ID string `json:"id"`
321
+
322
+ // ProductResourceType: type of resource to which the reference is associated.
323
+ ProductResourceType string `json:"product_resource_type"`
324
+
325
+ // ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
326
+ ProductResourceID string `json:"product_resource_id"`
327
+
328
+ // CreatedAt: creation date of the reference.
329
+ CreatedAt * time.Time `json:"created_at"`
330
+
331
+ // Type: type of reference (link, exclusive, read_only).
332
+ // Default value: unknown_type
333
+ Type ReferenceType `json:"type"`
334
+
335
+ // Status: status of reference (attaching, attached, detaching).
336
+ // Default value: unknown_status
337
+ Status ReferenceStatus `json:"status"`
338
+ }
339
+
317
340
// SnapshotParentVolume: snapshot parent volume.
318
341
type SnapshotParentVolume struct {
319
342
// ID: parent volume UUID (volume from which the snapshot originates).
@@ -340,29 +363,6 @@ type VolumeSpecifications struct {
340
363
Class StorageClass `json:"class"`
341
364
}
342
365
343
- // Reference: reference.
344
- type Reference struct {
345
- // ID: UUID of the reference.
346
- ID string `json:"id"`
347
-
348
- // ProductResourceType: type of resource to which the reference is associated.
349
- ProductResourceType string `json:"product_resource_type"`
350
-
351
- // ProductResourceID: UUID of the product resource it refers to (according to the product_resource_type).
352
- ProductResourceID string `json:"product_resource_id"`
353
-
354
- // CreatedAt: creation date of the reference.
355
- CreatedAt * time.Time `json:"created_at"`
356
-
357
- // Type: type of reference (link, exclusive, read_only).
358
- // Default value: unknown_type
359
- Type ReferenceType `json:"type"`
360
-
361
- // Status: status of reference (attaching, attached, detaching).
362
- // Default value: unknown_status
363
- Status ReferenceStatus `json:"status"`
364
- }
365
-
366
366
// CreateVolumeRequestFromEmpty: create volume request from empty.
367
367
type CreateVolumeRequestFromEmpty struct {
368
368
// Size: must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.
@@ -379,18 +379,18 @@ type CreateVolumeRequestFromSnapshot struct {
379
379
SnapshotID string `json:"snapshot_id"`
380
380
}
381
381
382
- // SnapshotSummary : snapshot summary .
383
- type SnapshotSummary struct {
382
+ // Snapshot : snapshot.
383
+ type Snapshot struct {
384
384
// ID: UUID of the snapshot.
385
385
ID string `json:"id"`
386
386
387
387
// Name: name of the snapshot.
388
388
Name string `json:"name"`
389
389
390
- // ParentVolume: if the parent volume has been deleted, value is null.
390
+ // ParentVolume: if the parent volume was deleted, value is null.
391
391
ParentVolume * SnapshotParentVolume `json:"parent_volume"`
392
392
393
- // Size: size of the snapshot in bytes .
393
+ // Size: size in bytes of the snapshot.
394
394
Size scw.Size `json:"size"`
395
395
396
396
// ProjectID: UUID of the project the snapshot belongs to.
@@ -402,14 +402,17 @@ type SnapshotSummary struct {
402
402
// UpdatedAt: last modification date of the properties of a snapshot.
403
403
UpdatedAt * time.Time `json:"updated_at"`
404
404
405
+ // References: list of the references to the snapshot.
406
+ References []* Reference `json:"references"`
407
+
405
408
// Status: current status of the snapshot (available, in_use, ...).
406
409
// Default value: unknown_status
407
410
Status SnapshotStatus `json:"status"`
408
411
409
412
// Tags: list of tags assigned to the volume.
410
413
Tags []string `json:"tags"`
411
414
412
- // Zone: snapshot Availability Zone .
415
+ // Zone: snapshot zone .
413
416
Zone scw.Zone `json:"zone"`
414
417
415
418
// Class: storage class of the snapshot.
@@ -590,7 +593,7 @@ type ListSnapshotsRequest struct {
590
593
// ListSnapshotsResponse: list snapshots response.
591
594
type ListSnapshotsResponse struct {
592
595
// Snapshots: paginated returned list of snapshots.
593
- Snapshots []* SnapshotSummary `json:"snapshots"`
596
+ Snapshots []* Snapshot `json:"snapshots"`
594
597
595
598
// TotalCount: total number of snpashots in the project.
596
599
TotalCount uint64 `json:"total_count"`
@@ -711,47 +714,6 @@ func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint64, error) {
711
714
return uint64 (len (results .Volumes )), nil
712
715
}
713
716
714
- // Snapshot: snapshot.
715
- type Snapshot struct {
716
- // ID: UUID of the snapshot.
717
- ID string `json:"id"`
718
-
719
- // Name: name of the snapshot.
720
- Name string `json:"name"`
721
-
722
- // ParentVolume: if the parent volume was deleted, value is null.
723
- ParentVolume * SnapshotParentVolume `json:"parent_volume"`
724
-
725
- // Size: size in bytes of the snapshot.
726
- Size scw.Size `json:"size"`
727
-
728
- // ProjectID: UUID of the project the snapshot belongs to.
729
- ProjectID string `json:"project_id"`
730
-
731
- // CreatedAt: creation date of the snapshot.
732
- CreatedAt * time.Time `json:"created_at"`
733
-
734
- // UpdatedAt: last modification date of the properties of a snapshot.
735
- UpdatedAt * time.Time `json:"updated_at"`
736
-
737
- // References: list of the references to the snapshot.
738
- References []* Reference `json:"references"`
739
-
740
- // Status: current status of the snapshot (available, in_use, ...).
741
- // Default value: unknown_status
742
- Status SnapshotStatus `json:"status"`
743
-
744
- // Tags: list of tags assigned to the volume.
745
- Tags []string `json:"tags"`
746
-
747
- // Zone: snapshot zone.
748
- Zone scw.Zone `json:"zone"`
749
-
750
- // Class: storage class of the snapshot.
751
- // Default value: unknown_storage_class
752
- Class StorageClass `json:"class"`
753
- }
754
-
755
717
// UpdateSnapshotRequest: update snapshot request.
756
718
type UpdateSnapshotRequest struct {
757
719
// Zone: zone to target. If none is passed will use default zone from the config.
0 commit comments