@scaleway/sdk 2.67.0 → 2.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/api/audit_trail/v1alpha1/api.gen.cjs +6 -1
  2. package/dist/api/audit_trail/v1alpha1/api.gen.js +6 -1
  3. package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +6 -0
  4. package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +6 -0
  5. package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +55 -15
  6. package/dist/api/audit_trail/v1alpha1/validation-rules.gen.cjs +3 -0
  7. package/dist/api/audit_trail/v1alpha1/validation-rules.gen.d.ts +3 -0
  8. package/dist/api/audit_trail/v1alpha1/validation-rules.gen.js +3 -0
  9. package/dist/api/baremetal/v1/api.gen.cjs +13 -0
  10. package/dist/api/baremetal/v1/api.gen.d.ts +8 -1
  11. package/dist/api/baremetal/v1/api.gen.js +13 -0
  12. package/dist/api/baremetal/v1/content.gen.cjs +2 -1
  13. package/dist/api/baremetal/v1/content.gen.js +2 -1
  14. package/dist/api/baremetal/v1/index.gen.d.ts +1 -1
  15. package/dist/api/baremetal/v1/marshalling.gen.cjs +1 -0
  16. package/dist/api/baremetal/v1/marshalling.gen.js +1 -0
  17. package/dist/api/baremetal/v1/types.gen.d.ts +9 -1
  18. package/dist/api/billing/v2beta1/api.gen.cjs +9 -2
  19. package/dist/api/billing/v2beta1/api.gen.d.ts +9 -2
  20. package/dist/api/billing/v2beta1/api.gen.js +9 -2
  21. package/dist/api/billing/v2beta1/types.gen.d.ts +1 -1
  22. package/dist/api/block/index.gen.cjs +4 -2
  23. package/dist/api/block/index.gen.d.ts +1 -0
  24. package/dist/api/block/index.gen.js +4 -2
  25. package/dist/api/block/v1/api.gen.cjs +303 -0
  26. package/dist/api/block/v1/api.gen.d.ts +152 -0
  27. package/dist/api/block/v1/api.gen.js +303 -0
  28. package/dist/api/block/v1/content.gen.cjs +22 -0
  29. package/dist/api/block/v1/content.gen.d.ts +7 -0
  30. package/dist/api/block/v1/content.gen.js +22 -0
  31. package/dist/api/block/v1/index.gen.cjs +10 -0
  32. package/dist/api/block/v1/index.gen.d.ts +4 -0
  33. package/dist/api/block/v1/index.gen.js +10 -0
  34. package/dist/api/block/v1/marshalling.gen.cjs +200 -0
  35. package/dist/api/block/v1/marshalling.gen.d.ts +14 -0
  36. package/dist/api/block/v1/marshalling.gen.js +200 -0
  37. package/dist/api/block/v1/types.gen.d.ts +335 -0
  38. package/dist/api/block/v1/validation-rules.gen.cjs +56 -0
  39. package/dist/api/block/v1/validation-rules.gen.d.ts +47 -0
  40. package/dist/api/block/v1/validation-rules.gen.js +56 -0
  41. package/dist/api/block/v1alpha1/api.gen.cjs +1 -0
  42. package/dist/api/block/v1alpha1/api.gen.js +1 -0
  43. package/dist/api/block/v1alpha1/types.gen.d.ts +5 -0
  44. package/dist/api/edge_services/index.gen.cjs +2 -0
  45. package/dist/api/edge_services/index.gen.d.ts +1 -0
  46. package/dist/api/edge_services/index.gen.js +3 -1
  47. package/dist/api/edge_services/v1beta1/api.gen.cjs +941 -0
  48. package/dist/api/edge_services/v1beta1/api.gen.d.ts +454 -0
  49. package/dist/api/edge_services/v1beta1/api.gen.js +941 -0
  50. package/dist/api/edge_services/v1beta1/content.gen.cjs +8 -0
  51. package/dist/api/edge_services/v1beta1/content.gen.d.ts +5 -0
  52. package/dist/api/edge_services/v1beta1/content.gen.js +8 -0
  53. package/dist/api/{webhosting/v1alpha1 → edge_services/v1beta1}/index.gen.cjs +2 -2
  54. package/dist/api/edge_services/v1beta1/index.gen.d.ts +4 -0
  55. package/dist/api/edge_services/v1beta1/index.gen.js +9 -0
  56. package/dist/api/edge_services/v1beta1/marshalling.gen.cjs +809 -0
  57. package/dist/api/edge_services/v1beta1/marshalling.gen.d.ts +54 -0
  58. package/dist/api/edge_services/v1beta1/marshalling.gen.js +809 -0
  59. package/dist/api/edge_services/v1beta1/types.gen.d.ts +1218 -0
  60. package/dist/api/edge_services/v1beta1/validation-rules.gen.cjs +23 -0
  61. package/dist/api/edge_services/v1beta1/validation-rules.gen.d.ts +18 -0
  62. package/dist/api/edge_services/v1beta1/validation-rules.gen.js +23 -0
  63. package/dist/api/iam/v1alpha1/api.gen.cjs +7 -0
  64. package/dist/api/iam/v1alpha1/api.gen.d.ts +2 -1
  65. package/dist/api/iam/v1alpha1/api.gen.js +8 -1
  66. package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
  67. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +51 -0
  68. package/dist/api/iam/v1alpha1/marshalling.gen.d.ts +2 -1
  69. package/dist/api/iam/v1alpha1/marshalling.gen.js +51 -0
  70. package/dist/api/iam/v1alpha1/types.gen.d.ts +24 -0
  71. package/dist/api/instance/v1/api.gen.cjs +18 -0
  72. package/dist/api/instance/v1/api.gen.d.ts +13 -1
  73. package/dist/api/instance/v1/api.gen.js +19 -1
  74. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  75. package/dist/api/instance/v1/marshalling.gen.cjs +12 -0
  76. package/dist/api/instance/v1/marshalling.gen.d.ts +2 -1
  77. package/dist/api/instance/v1/marshalling.gen.js +12 -0
  78. package/dist/api/instance/v1/types.gen.d.ts +12 -0
  79. package/dist/api/lb/v1/marshalling.gen.cjs +2 -0
  80. package/dist/api/lb/v1/marshalling.gen.js +2 -0
  81. package/dist/api/lb/v1/types.gen.d.ts +2 -0
  82. package/dist/api/mongodb/v1alpha1/api.gen.cjs +11 -0
  83. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +2 -1
  84. package/dist/api/mongodb/v1alpha1/api.gen.js +12 -1
  85. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
  86. package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +26 -1
  87. package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +2 -1
  88. package/dist/api/mongodb/v1alpha1/marshalling.gen.js +26 -1
  89. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +29 -0
  90. package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +8 -0
  91. package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +7 -0
  92. package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +8 -0
  93. package/dist/api/secret/v1beta1/api.gen.cjs +2 -34
  94. package/dist/api/secret/v1beta1/api.gen.d.ts +3 -19
  95. package/dist/api/secret/v1beta1/api.gen.js +2 -34
  96. package/dist/api/secret/v1beta1/index.gen.d.ts +1 -1
  97. package/dist/api/secret/v1beta1/types.gen.d.ts +3 -19
  98. package/dist/api/tem/v1alpha1/types.gen.d.ts +5 -5
  99. package/dist/api/vpcgw/v1/api.gen.cjs +7 -0
  100. package/dist/api/vpcgw/v1/api.gen.d.ts +7 -0
  101. package/dist/api/vpcgw/v1/api.gen.js +7 -0
  102. package/dist/api/vpcgw/v1/types.gen.d.ts +1 -0
  103. package/dist/api/webhosting/index.gen.cjs +0 -2
  104. package/dist/api/webhosting/index.gen.d.ts +0 -1
  105. package/dist/api/webhosting/index.gen.js +1 -3
  106. package/dist/api/webhosting/v1/content.gen.cjs +0 -6
  107. package/dist/api/webhosting/v1/content.gen.d.ts +1 -3
  108. package/dist/api/webhosting/v1/content.gen.js +0 -6
  109. package/dist/api/webhosting/v1/index.gen.cjs +0 -1
  110. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  111. package/dist/api/webhosting/v1/index.gen.js +1 -2
  112. package/dist/api/webhosting/v1/marshalling.gen.cjs +1 -2
  113. package/dist/api/webhosting/v1/marshalling.gen.js +1 -2
  114. package/dist/api/webhosting/v1/types.gen.d.ts +3 -6
  115. package/dist/scw/constants.cjs +1 -1
  116. package/dist/scw/constants.d.ts +2 -2
  117. package/dist/scw/constants.js +1 -1
  118. package/dist/scw/errors/standard/quotas-exceeded-error.cjs +1 -1
  119. package/dist/scw/errors/standard/quotas-exceeded-error.d.ts +4 -4
  120. package/dist/scw/errors/standard/quotas-exceeded-error.js +1 -1
  121. package/package.json +2 -2
  122. package/dist/api/webhosting/v1alpha1/api.gen.cjs +0 -339
  123. package/dist/api/webhosting/v1alpha1/api.gen.d.ts +0 -168
  124. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -339
  125. package/dist/api/webhosting/v1alpha1/content.gen.cjs +0 -8
  126. package/dist/api/webhosting/v1alpha1/content.gen.d.ts +0 -3
  127. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -8
  128. package/dist/api/webhosting/v1alpha1/index.gen.d.ts +0 -4
  129. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -9
  130. package/dist/api/webhosting/v1alpha1/marshalling.gen.cjs +0 -300
  131. package/dist/api/webhosting/v1alpha1/marshalling.gen.d.ts +0 -17
  132. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -300
  133. package/dist/api/webhosting/v1alpha1/types.gen.d.ts +0 -480
  134. package/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs +0 -32
  135. package/dist/api/webhosting/v1alpha1/validation-rules.gen.d.ts +0 -27
  136. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -32
@@ -0,0 +1,200 @@
1
+ import randomName from "@scaleway/random-name";
2
+ import { isJSONObject } from "../../../helpers/json.js";
3
+ import { unmarshalMoney } from "../../../scw/custom-marshalling.js";
4
+ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
5
+ const unmarshalReference = (data) => {
6
+ if (!isJSONObject(data)) {
7
+ throw new TypeError(
8
+ `Unmarshalling the type 'Reference' failed as data isn't a dictionary.`
9
+ );
10
+ }
11
+ return {
12
+ createdAt: unmarshalDate(data.created_at),
13
+ id: data.id,
14
+ productResourceId: data.product_resource_id,
15
+ productResourceType: data.product_resource_type,
16
+ status: data.status,
17
+ type: data.type
18
+ };
19
+ };
20
+ const unmarshalSnapshotParentVolume = (data) => {
21
+ if (!isJSONObject(data)) {
22
+ throw new TypeError(
23
+ `Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`
24
+ );
25
+ }
26
+ return {
27
+ id: data.id,
28
+ name: data.name,
29
+ status: data.status,
30
+ type: data.type
31
+ };
32
+ };
33
+ const unmarshalSnapshot = (data) => {
34
+ if (!isJSONObject(data)) {
35
+ throw new TypeError(
36
+ `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`
37
+ );
38
+ }
39
+ return {
40
+ class: data.class,
41
+ createdAt: unmarshalDate(data.created_at),
42
+ id: data.id,
43
+ name: data.name,
44
+ parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : void 0,
45
+ projectId: data.project_id,
46
+ references: unmarshalArrayOfObject(data.references, unmarshalReference),
47
+ size: data.size,
48
+ status: data.status,
49
+ tags: data.tags,
50
+ updatedAt: unmarshalDate(data.updated_at),
51
+ zone: data.zone
52
+ };
53
+ };
54
+ const unmarshalVolumeSpecifications = (data) => {
55
+ if (!isJSONObject(data)) {
56
+ throw new TypeError(
57
+ `Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`
58
+ );
59
+ }
60
+ return {
61
+ class: data.class,
62
+ perfIops: data.perf_iops
63
+ };
64
+ };
65
+ const unmarshalVolume = (data) => {
66
+ if (!isJSONObject(data)) {
67
+ throw new TypeError(
68
+ `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`
69
+ );
70
+ }
71
+ return {
72
+ createdAt: unmarshalDate(data.created_at),
73
+ id: data.id,
74
+ lastDetachedAt: unmarshalDate(data.last_detached_at),
75
+ name: data.name,
76
+ parentSnapshotId: data.parent_snapshot_id,
77
+ projectId: data.project_id,
78
+ references: unmarshalArrayOfObject(data.references, unmarshalReference),
79
+ size: data.size,
80
+ specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0,
81
+ status: data.status,
82
+ tags: data.tags,
83
+ type: data.type,
84
+ updatedAt: unmarshalDate(data.updated_at),
85
+ zone: data.zone
86
+ };
87
+ };
88
+ const unmarshalListSnapshotsResponse = (data) => {
89
+ if (!isJSONObject(data)) {
90
+ throw new TypeError(
91
+ `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`
92
+ );
93
+ }
94
+ return {
95
+ snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
96
+ totalCount: data.total_count
97
+ };
98
+ };
99
+ const unmarshalVolumeType = (data) => {
100
+ if (!isJSONObject(data)) {
101
+ throw new TypeError(
102
+ `Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`
103
+ );
104
+ }
105
+ return {
106
+ pricing: data.pricing ? unmarshalMoney(data.pricing) : void 0,
107
+ snapshotPricing: data.snapshot_pricing ? unmarshalMoney(data.snapshot_pricing) : void 0,
108
+ specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0,
109
+ type: data.type
110
+ };
111
+ };
112
+ const unmarshalListVolumeTypesResponse = (data) => {
113
+ if (!isJSONObject(data)) {
114
+ throw new TypeError(
115
+ `Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`
116
+ );
117
+ }
118
+ return {
119
+ totalCount: data.total_count,
120
+ volumeTypes: unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType)
121
+ };
122
+ };
123
+ const unmarshalListVolumesResponse = (data) => {
124
+ if (!isJSONObject(data)) {
125
+ throw new TypeError(
126
+ `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`
127
+ );
128
+ }
129
+ return {
130
+ totalCount: data.total_count,
131
+ volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
132
+ };
133
+ };
134
+ const marshalCreateSnapshotRequest = (request, defaults) => ({
135
+ name: request.name || randomName("snp"),
136
+ project_id: request.projectId ?? defaults.defaultProjectId,
137
+ tags: request.tags,
138
+ volume_id: request.volumeId
139
+ });
140
+ const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({
141
+ size: request.size
142
+ });
143
+ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
144
+ size: request.size,
145
+ snapshot_id: request.snapshotId
146
+ });
147
+ const marshalCreateVolumeRequest = (request, defaults) => ({
148
+ name: request.name || randomName("vol"),
149
+ project_id: request.projectId ?? defaults.defaultProjectId,
150
+ tags: request.tags,
151
+ ...resolveOneOf([
152
+ {
153
+ param: "from_empty",
154
+ value: request.fromEmpty !== void 0 ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : void 0
155
+ },
156
+ {
157
+ param: "from_snapshot",
158
+ value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot(
159
+ request.fromSnapshot
160
+ ) : void 0
161
+ }
162
+ ]),
163
+ ...resolveOneOf([{ param: "perf_iops", value: request.perfIops }])
164
+ });
165
+ const marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({
166
+ bucket: request.bucket,
167
+ key: request.key
168
+ });
169
+ const marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({
170
+ bucket: request.bucket,
171
+ key: request.key,
172
+ name: request.name,
173
+ project_id: request.projectId ?? defaults.defaultProjectId,
174
+ size: request.size,
175
+ tags: request.tags
176
+ });
177
+ const marshalUpdateSnapshotRequest = (request, defaults) => ({
178
+ name: request.name,
179
+ tags: request.tags
180
+ });
181
+ const marshalUpdateVolumeRequest = (request, defaults) => ({
182
+ name: request.name,
183
+ perf_iops: request.perfIops,
184
+ size: request.size,
185
+ tags: request.tags
186
+ });
187
+ export {
188
+ marshalCreateSnapshotRequest,
189
+ marshalCreateVolumeRequest,
190
+ marshalExportSnapshotToObjectStorageRequest,
191
+ marshalImportSnapshotFromObjectStorageRequest,
192
+ marshalUpdateSnapshotRequest,
193
+ marshalUpdateVolumeRequest,
194
+ unmarshalListSnapshotsResponse,
195
+ unmarshalListVolumeTypesResponse,
196
+ unmarshalListVolumesResponse,
197
+ unmarshalReference,
198
+ unmarshalSnapshot,
199
+ unmarshalVolume
200
+ };
@@ -0,0 +1,335 @@
1
+ import type { Money, Zone as ScwZone } from '../../../bridge';
2
+ export type ListSnapshotsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
3
+ export type ListVolumesRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
4
+ export type ReferenceStatus = 'unknown_status' | 'attaching' | 'attached' | 'detaching' | 'detached' | 'creating' | 'error';
5
+ export type ReferenceType = 'unknown_type' | 'link' | 'exclusive' | 'read_only';
6
+ export type SnapshotStatus = 'unknown_status' | 'creating' | 'available' | 'error' | 'deleting' | 'deleted' | 'in_use' | 'locked' | 'exporting';
7
+ export type StorageClass = 'unknown_storage_class' | 'unspecified' | 'bssd' | 'sbs';
8
+ export type VolumeStatus = 'unknown_status' | 'creating' | 'available' | 'in_use' | 'deleting' | 'deleted' | 'resizing' | 'error' | 'snapshotting' | 'locked' | 'updating';
9
+ export interface Reference {
10
+ /** UUID of the reference. */
11
+ id: string;
12
+ /** Type of resource to which the reference is associated. */
13
+ productResourceType: string;
14
+ /**
15
+ * UUID of the product resource it refers to (according to the
16
+ * product_resource_type).
17
+ */
18
+ productResourceId: string;
19
+ /** Creation date of the reference. */
20
+ createdAt?: Date;
21
+ /** Type of reference (link, exclusive, read_only). */
22
+ type: ReferenceType;
23
+ /**
24
+ * Status of the reference. Statuses include `attaching`, `attached`, and
25
+ * `detaching`.
26
+ */
27
+ status: ReferenceStatus;
28
+ }
29
+ export interface SnapshotParentVolume {
30
+ /** Parent volume UUID (volume from which the snapshot originates). */
31
+ id: string;
32
+ /** Name of the parent volume. */
33
+ name: string;
34
+ /** Volume type of the parent volume. */
35
+ type: string;
36
+ /** Current status the parent volume. */
37
+ status: VolumeStatus;
38
+ }
39
+ export interface VolumeSpecifications {
40
+ /**
41
+ * The maximum IO/s expected, according to the different options available in
42
+ * stock (`5000 | 15000`).
43
+ */
44
+ perfIops?: number;
45
+ /** The storage class of the volume. */
46
+ class: StorageClass;
47
+ }
48
+ export interface CreateVolumeRequestFromEmpty {
49
+ /** Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size. */
50
+ size: number;
51
+ }
52
+ export interface CreateVolumeRequestFromSnapshot {
53
+ /**
54
+ * Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size.
55
+ * Size is optional and is used only if a resize of the volume is requested,
56
+ * otherwise original snapshot size will be used.
57
+ */
58
+ size?: number;
59
+ /** Source snapshot from which volume will be created. */
60
+ snapshotId: string;
61
+ }
62
+ export interface Snapshot {
63
+ /** UUID of the snapshot. */
64
+ id: string;
65
+ /** Name of the snapshot. */
66
+ name: string;
67
+ /** If the parent volume was deleted, value is null. */
68
+ parentVolume?: SnapshotParentVolume;
69
+ /** Size in bytes of the snapshot. */
70
+ size: number;
71
+ /** UUID of the project the snapshot belongs to. */
72
+ projectId: string;
73
+ /** Creation date of the snapshot. */
74
+ createdAt?: Date;
75
+ /** Last modification date of the properties of a snapshot. */
76
+ updatedAt?: Date;
77
+ /** List of the references to the snapshot. */
78
+ references: Reference[];
79
+ /** Current status of the snapshot (available, in_use, ...). */
80
+ status: SnapshotStatus;
81
+ /** List of tags assigned to the volume. */
82
+ tags: string[];
83
+ /** Snapshot zone. */
84
+ zone: ScwZone;
85
+ /** Storage class of the snapshot. */
86
+ class: StorageClass;
87
+ }
88
+ export interface VolumeType {
89
+ /** Volume type. */
90
+ type: string;
91
+ /** Price of the volume billed in GB/hour. */
92
+ pricing?: Money;
93
+ /** Price of the snapshot billed in GB/hour. */
94
+ snapshotPricing?: Money;
95
+ /** Volume specifications of the volume type. */
96
+ specs?: VolumeSpecifications;
97
+ }
98
+ export interface Volume {
99
+ /** UUID of the volume. */
100
+ id: string;
101
+ /** Name of the volume. */
102
+ name: string;
103
+ /** Volume type. */
104
+ type: string;
105
+ /** Volume size in bytes. */
106
+ size: number;
107
+ /** UUID of the project to which the volume belongs. */
108
+ projectId: string;
109
+ /** Creation date of the volume. */
110
+ createdAt?: Date;
111
+ /** Last update of the properties of a volume. */
112
+ updatedAt?: Date;
113
+ /** List of the references to the volume. */
114
+ references: Reference[];
115
+ /**
116
+ * When a volume is created from a snapshot, is the UUID of the snapshot from
117
+ * which the volume has been created.
118
+ */
119
+ parentSnapshotId?: string;
120
+ /** Current status of the volume (available, in_use, ...). */
121
+ status: VolumeStatus;
122
+ /** List of tags assigned to the volume. */
123
+ tags: string[];
124
+ /** Volume zone. */
125
+ zone: ScwZone;
126
+ /** Specifications of the volume. */
127
+ specs?: VolumeSpecifications;
128
+ /** Last time the volume was detached. */
129
+ lastDetachedAt?: Date;
130
+ }
131
+ export type CreateSnapshotRequest = {
132
+ /** Zone to target. If none is passed will use default zone from the config. */
133
+ zone?: ScwZone;
134
+ /** UUID of the volume to snapshot. */
135
+ volumeId: string;
136
+ /** Name of the snapshot. */
137
+ name?: string;
138
+ /** UUID of the project to which the volume and the snapshot belong. */
139
+ projectId?: string;
140
+ /** List of tags assigned to the snapshot. */
141
+ tags?: string[];
142
+ };
143
+ export type CreateVolumeRequest = {
144
+ /** Zone to target. If none is passed will use default zone from the config. */
145
+ zone?: ScwZone;
146
+ /** Name of the volume. */
147
+ name?: string;
148
+ /**
149
+ * The maximum IO/s expected, according to the different options available in
150
+ * stock (`5000 | 15000`).
151
+ *
152
+ * One-of ('requirements'): at most one of 'perfIops' could be set.
153
+ */
154
+ perfIops?: number;
155
+ /** UUID of the project the volume belongs to. */
156
+ projectId?: string;
157
+ /**
158
+ * Specify the size of the new volume if creating a new one from scratch.
159
+ *
160
+ * One-of ('from'): at most one of 'fromEmpty', 'fromSnapshot' could be set.
161
+ */
162
+ fromEmpty?: CreateVolumeRequestFromEmpty;
163
+ /**
164
+ * Specify the snapshot ID of the original snapshot.
165
+ *
166
+ * One-of ('from'): at most one of 'fromEmpty', 'fromSnapshot' could be set.
167
+ */
168
+ fromSnapshot?: CreateVolumeRequestFromSnapshot;
169
+ /** List of tags assigned to the volume. */
170
+ tags?: string[];
171
+ };
172
+ export type DeleteSnapshotRequest = {
173
+ /** Zone to target. If none is passed will use default zone from the config. */
174
+ zone?: ScwZone;
175
+ /** UUID of the snapshot. */
176
+ snapshotId: string;
177
+ };
178
+ export type DeleteVolumeRequest = {
179
+ /** Zone to target. If none is passed will use default zone from the config. */
180
+ zone?: ScwZone;
181
+ /** UUID of the volume. */
182
+ volumeId: string;
183
+ };
184
+ export type ExportSnapshotToObjectStorageRequest = {
185
+ /** Zone to target. If none is passed will use default zone from the config. */
186
+ zone?: ScwZone;
187
+ /** UUID of the snapshot. */
188
+ snapshotId: string;
189
+ /** Scaleway Object Storage bucket where the object is stored. */
190
+ bucket: string;
191
+ /** The object key inside the given bucket. */
192
+ key: string;
193
+ };
194
+ export type GetSnapshotRequest = {
195
+ /** Zone to target. If none is passed will use default zone from the config. */
196
+ zone?: ScwZone;
197
+ /** UUID of the snapshot. */
198
+ snapshotId: string;
199
+ };
200
+ export type GetVolumeRequest = {
201
+ /** Zone to target. If none is passed will use default zone from the config. */
202
+ zone?: ScwZone;
203
+ /** UUID of the volume. */
204
+ volumeId: string;
205
+ };
206
+ export type ImportSnapshotFromObjectStorageRequest = {
207
+ /** Zone to target. If none is passed will use default zone from the config. */
208
+ zone?: ScwZone;
209
+ /** Scaleway Object Storage bucket where the object is stored. */
210
+ bucket: string;
211
+ /** The object key inside the given bucket. */
212
+ key: string;
213
+ /** Name of the snapshot. */
214
+ name: string;
215
+ /** UUID of the Project to which the volume and the snapshot belong. */
216
+ projectId?: string;
217
+ /** List of tags assigned to the snapshot. */
218
+ tags?: string[];
219
+ /** Size of the snapshot. */
220
+ size?: number;
221
+ };
222
+ export type ListSnapshotsRequest = {
223
+ /** Zone to target. If none is passed will use default zone from the config. */
224
+ zone?: ScwZone;
225
+ /** Criteria to use when ordering the list. */
226
+ orderBy?: ListSnapshotsRequestOrderBy;
227
+ /** Filter by Project ID. */
228
+ projectId?: string;
229
+ /** Filter by Organization ID. */
230
+ organizationId?: string;
231
+ /** Page number. */
232
+ page?: number;
233
+ /**
234
+ * Page size, defines how many entries are returned in one page, must be lower
235
+ * or equal to 100.
236
+ */
237
+ pageSize?: number;
238
+ /** Filter snapshots by the ID of the original volume. */
239
+ volumeId?: string;
240
+ /** Filter snapshots by their names. */
241
+ name?: string;
242
+ /**
243
+ * Filter by tags. Only snapshots with one or more matching tags will be
244
+ * returned.
245
+ */
246
+ tags?: string[];
247
+ };
248
+ export interface ListSnapshotsResponse {
249
+ /** Paginated returned list of snapshots. */
250
+ snapshots: Snapshot[];
251
+ /** Total number of snpashots in the project. */
252
+ totalCount: number;
253
+ }
254
+ export type ListVolumeTypesRequest = {
255
+ /** Zone to target. If none is passed will use default zone from the config. */
256
+ zone?: ScwZone;
257
+ /** Page number. */
258
+ page?: number;
259
+ /**
260
+ * Page size, defines how many entries are returned in one page, must be lower
261
+ * or equal to 100.
262
+ */
263
+ pageSize?: number;
264
+ };
265
+ export interface ListVolumeTypesResponse {
266
+ /** Returns paginated list of volume-types. */
267
+ volumeTypes: VolumeType[];
268
+ /** Total number of volume-types currently available in stock. */
269
+ totalCount: number;
270
+ }
271
+ export type ListVolumesRequest = {
272
+ /** Zone to target. If none is passed will use default zone from the config. */
273
+ zone?: ScwZone;
274
+ /** Criteria to use when ordering the list. */
275
+ orderBy?: ListVolumesRequestOrderBy;
276
+ /** Filter by Project ID. */
277
+ projectId?: string;
278
+ /** Filter by Organization ID. */
279
+ organizationId?: string;
280
+ /** Page number. */
281
+ page?: number;
282
+ /**
283
+ * Page size, defines how many entries are returned in one page, must be lower
284
+ * or equal to 100.
285
+ */
286
+ pageSize?: number;
287
+ /** Filter the return volumes by their names. */
288
+ name?: string;
289
+ /**
290
+ * Filter by a product resource ID linked to this volume (such as an Instance
291
+ * ID).
292
+ */
293
+ productResourceId?: string;
294
+ /**
295
+ * Filter by tags. Only volumes with one or more matching tags will be
296
+ * returned.
297
+ */
298
+ tags?: string[];
299
+ };
300
+ export interface ListVolumesResponse {
301
+ /** Paginated returned list of volumes. */
302
+ volumes: Volume[];
303
+ /** Total number of volumes in the project. */
304
+ totalCount: number;
305
+ }
306
+ export type UpdateSnapshotRequest = {
307
+ /** Zone to target. If none is passed will use default zone from the config. */
308
+ zone?: ScwZone;
309
+ /** UUID of the snapshot. */
310
+ snapshotId: string;
311
+ /** When defined, is the name of the snapshot. */
312
+ name?: string;
313
+ /** List of tags assigned to the snapshot. */
314
+ tags?: string[];
315
+ };
316
+ export type UpdateVolumeRequest = {
317
+ /** Zone to target. If none is passed will use default zone from the config. */
318
+ zone?: ScwZone;
319
+ /** UUID of the volume. */
320
+ volumeId: string;
321
+ /** When defined, is the new name of the volume. */
322
+ name?: string;
323
+ /**
324
+ * Size in bytes of the volume, with a granularity of 1 GB (10^9 bytes). Must
325
+ * be compliant with the minimum (1GB) and maximum (10TB) allowed size.
326
+ */
327
+ size?: number;
328
+ /** List of tags assigned to the volume. */
329
+ tags?: string[];
330
+ /**
331
+ * The selected value must be available for the volume's current storage
332
+ * class.
333
+ */
334
+ perfIops?: number;
335
+ };
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const CreateSnapshotRequest = {
4
+ name: {
5
+ minLength: 1
6
+ }
7
+ };
8
+ const CreateVolumeRequest = {
9
+ name: {
10
+ minLength: 1
11
+ }
12
+ };
13
+ const ImportSnapshotFromObjectStorageRequest = {
14
+ name: {
15
+ minLength: 1
16
+ }
17
+ };
18
+ const ListSnapshotsRequest = {
19
+ page: {
20
+ greaterThan: 0
21
+ },
22
+ pageSize: {
23
+ greaterThan: 0,
24
+ lessThanOrEqual: 100
25
+ }
26
+ };
27
+ const ListVolumeTypesRequest = {
28
+ page: {
29
+ greaterThan: 0
30
+ },
31
+ pageSize: {
32
+ greaterThan: 0,
33
+ lessThanOrEqual: 100
34
+ }
35
+ };
36
+ const ListVolumesRequest = {
37
+ page: {
38
+ greaterThan: 0
39
+ },
40
+ pageSize: {
41
+ greaterThan: 0,
42
+ lessThanOrEqual: 100
43
+ }
44
+ };
45
+ const Reference = {
46
+ productResourceType: {
47
+ minLength: 1
48
+ }
49
+ };
50
+ exports.CreateSnapshotRequest = CreateSnapshotRequest;
51
+ exports.CreateVolumeRequest = CreateVolumeRequest;
52
+ exports.ImportSnapshotFromObjectStorageRequest = ImportSnapshotFromObjectStorageRequest;
53
+ exports.ListSnapshotsRequest = ListSnapshotsRequest;
54
+ exports.ListVolumeTypesRequest = ListVolumeTypesRequest;
55
+ exports.ListVolumesRequest = ListVolumesRequest;
56
+ exports.Reference = Reference;
@@ -0,0 +1,47 @@
1
+ export declare const CreateSnapshotRequest: {
2
+ name: {
3
+ minLength: number;
4
+ };
5
+ };
6
+ export declare const CreateVolumeRequest: {
7
+ name: {
8
+ minLength: number;
9
+ };
10
+ };
11
+ export declare const ImportSnapshotFromObjectStorageRequest: {
12
+ name: {
13
+ minLength: number;
14
+ };
15
+ };
16
+ export declare const ListSnapshotsRequest: {
17
+ page: {
18
+ greaterThan: number;
19
+ };
20
+ pageSize: {
21
+ greaterThan: number;
22
+ lessThanOrEqual: number;
23
+ };
24
+ };
25
+ export declare const ListVolumeTypesRequest: {
26
+ page: {
27
+ greaterThan: number;
28
+ };
29
+ pageSize: {
30
+ greaterThan: number;
31
+ lessThanOrEqual: number;
32
+ };
33
+ };
34
+ export declare const ListVolumesRequest: {
35
+ page: {
36
+ greaterThan: number;
37
+ };
38
+ pageSize: {
39
+ greaterThan: number;
40
+ lessThanOrEqual: number;
41
+ };
42
+ };
43
+ export declare const Reference: {
44
+ productResourceType: {
45
+ minLength: number;
46
+ };
47
+ };
@@ -0,0 +1,56 @@
1
+ const CreateSnapshotRequest = {
2
+ name: {
3
+ minLength: 1
4
+ }
5
+ };
6
+ const CreateVolumeRequest = {
7
+ name: {
8
+ minLength: 1
9
+ }
10
+ };
11
+ const ImportSnapshotFromObjectStorageRequest = {
12
+ name: {
13
+ minLength: 1
14
+ }
15
+ };
16
+ const ListSnapshotsRequest = {
17
+ page: {
18
+ greaterThan: 0
19
+ },
20
+ pageSize: {
21
+ greaterThan: 0,
22
+ lessThanOrEqual: 100
23
+ }
24
+ };
25
+ const ListVolumeTypesRequest = {
26
+ page: {
27
+ greaterThan: 0
28
+ },
29
+ pageSize: {
30
+ greaterThan: 0,
31
+ lessThanOrEqual: 100
32
+ }
33
+ };
34
+ const ListVolumesRequest = {
35
+ page: {
36
+ greaterThan: 0
37
+ },
38
+ pageSize: {
39
+ greaterThan: 0,
40
+ lessThanOrEqual: 100
41
+ }
42
+ };
43
+ const Reference = {
44
+ productResourceType: {
45
+ minLength: 1
46
+ }
47
+ };
48
+ export {
49
+ CreateSnapshotRequest,
50
+ CreateVolumeRequest,
51
+ ImportSnapshotFromObjectStorageRequest,
52
+ ListSnapshotsRequest,
53
+ ListVolumeTypesRequest,
54
+ ListVolumesRequest,
55
+ Reference
56
+ };
@@ -167,6 +167,7 @@ class API extends api.API {
167
167
  request.pageSize ?? this.client.settings.defaultPageSize
168
168
  ],
169
169
  ["project_id", request.projectId],
170
+ ["tags", request.tags],
170
171
  ["volume_id", request.volumeId]
171
172
  )
172
173
  },