@scaleway/sdk 2.53.0 → 2.55.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 (60) hide show
  1. package/dist/api/applesilicon/v1alpha1/api.gen.cjs +21 -0
  2. package/dist/api/applesilicon/v1alpha1/api.gen.d.ts +3 -1
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +22 -1
  4. package/dist/api/applesilicon/v1alpha1/index.gen.d.ts +1 -1
  5. package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +46 -0
  6. package/dist/api/applesilicon/v1alpha1/marshalling.gen.d.ts +4 -1
  7. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +47 -1
  8. package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +31 -0
  9. package/dist/api/block/v1alpha1/api.gen.cjs +3 -2
  10. package/dist/api/block/v1alpha1/api.gen.d.ts +1 -1
  11. package/dist/api/block/v1alpha1/api.gen.js +3 -2
  12. package/dist/api/block/v1alpha1/marshalling.gen.cjs +3 -2
  13. package/dist/api/block/v1alpha1/marshalling.gen.js +3 -2
  14. package/dist/api/block/v1alpha1/types.gen.d.ts +7 -2
  15. package/dist/api/cockpit/v1/api.gen.cjs +21 -2
  16. package/dist/api/cockpit/v1/api.gen.d.ts +16 -3
  17. package/dist/api/cockpit/v1/api.gen.js +22 -3
  18. package/dist/api/cockpit/v1/index.gen.d.ts +1 -1
  19. package/dist/api/cockpit/v1/marshalling.gen.cjs +31 -1
  20. package/dist/api/cockpit/v1/marshalling.gen.d.ts +2 -1
  21. package/dist/api/cockpit/v1/marshalling.gen.js +31 -1
  22. package/dist/api/cockpit/v1/types.gen.d.ts +33 -1
  23. package/dist/api/cockpit/v1/validation-rules.gen.cjs +11 -0
  24. package/dist/api/cockpit/v1/validation-rules.gen.d.ts +11 -0
  25. package/dist/api/cockpit/v1/validation-rules.gen.js +11 -0
  26. package/dist/api/container/v1beta1/marshalling.gen.cjs +7 -3
  27. package/dist/api/container/v1beta1/marshalling.gen.js +7 -3
  28. package/dist/api/container/v1beta1/types.gen.d.ts +17 -2
  29. package/dist/api/edge_services/v1alpha1/types.gen.d.ts +4 -4
  30. package/dist/api/function/v1beta1/marshalling.gen.cjs +3 -1
  31. package/dist/api/function/v1beta1/marshalling.gen.js +3 -1
  32. package/dist/api/function/v1beta1/types.gen.d.ts +4 -0
  33. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +1 -0
  34. package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
  35. package/dist/api/iam/v1alpha1/types.gen.d.ts +5 -0
  36. package/dist/api/ipam/v1/types.gen.d.ts +1 -1
  37. package/dist/api/jobs/v1alpha1/api.gen.cjs +29 -0
  38. package/dist/api/jobs/v1alpha1/api.gen.d.ts +29 -0
  39. package/dist/api/jobs/v1alpha1/api.gen.js +29 -0
  40. package/dist/api/jobs/v1alpha1/types.gen.d.ts +38 -6
  41. package/dist/api/k8s/v1/api.gen.cjs +1 -1
  42. package/dist/api/k8s/v1/api.gen.js +1 -1
  43. package/dist/api/k8s/v1/types.gen.d.ts +1 -1
  44. package/dist/api/mongodb/v1alpha1/api.gen.cjs +16 -16
  45. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +10 -1
  46. package/dist/api/mongodb/v1alpha1/api.gen.js +16 -16
  47. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
  48. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +9 -0
  49. package/dist/api/webhosting/v1/api.gen.cjs +16 -8
  50. package/dist/api/webhosting/v1/api.gen.d.ts +9 -1
  51. package/dist/api/webhosting/v1/api.gen.js +17 -9
  52. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  53. package/dist/api/webhosting/v1/marshalling.gen.cjs +14 -0
  54. package/dist/api/webhosting/v1/marshalling.gen.d.ts +2 -1
  55. package/dist/api/webhosting/v1/marshalling.gen.js +14 -0
  56. package/dist/api/webhosting/v1/types.gen.d.ts +19 -0
  57. package/dist/scw/constants.cjs +1 -1
  58. package/dist/scw/constants.d.ts +2 -2
  59. package/dist/scw/constants.js +1 -1
  60. package/package.json +2 -2
@@ -219,5 +219,26 @@ class API extends api.API {
219
219
  },
220
220
  marshalling_gen.unmarshalServer
221
221
  );
222
+ startConnectivityDiagnostic = (request) => this.client.fetch(
223
+ {
224
+ body: JSON.stringify(
225
+ marshalling_gen.marshalStartConnectivityDiagnosticRequest(
226
+ request,
227
+ this.client.settings
228
+ )
229
+ ),
230
+ headers: jsonContentHeaders,
231
+ method: "POST",
232
+ path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics`
233
+ },
234
+ marshalling_gen.unmarshalStartConnectivityDiagnosticResponse
235
+ );
236
+ getConnectivityDiagnostic = (request) => this.client.fetch(
237
+ {
238
+ method: "GET",
239
+ path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics/${marshalling.validatePathParam("diagnosticId", request.diagnosticId)}`
240
+ },
241
+ marshalling_gen.unmarshalConnectivityDiagnostic
242
+ );
222
243
  }
223
244
  exports.API = API;
@@ -1,6 +1,6 @@
1
1
  import { API as ParentAPI } from '../../../bridge';
2
2
  import type { WaitForOptions, Zone } from '../../../bridge';
3
- import type { CreateServerRequest, DeleteServerRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersResponse, OS, RebootServerRequest, ReinstallServerRequest, Server, ServerType, UpdateServerRequest } from './types.gen';
3
+ import type { ConnectivityDiagnostic, CreateServerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersResponse, OS, RebootServerRequest, ReinstallServerRequest, Server, ServerType, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest } from './types.gen';
4
4
  /**
5
5
  * Apple silicon API.
6
6
  *
@@ -120,4 +120,6 @@ export declare class API extends ParentAPI {
120
120
  * @returns A Promise of Server
121
121
  */
122
122
  reinstallServer: (request: Readonly<ReinstallServerRequest>) => Promise<Server>;
123
+ startConnectivityDiagnostic: (request: Readonly<StartConnectivityDiagnosticRequest>) => Promise<StartConnectivityDiagnosticResponse>;
124
+ getConnectivityDiagnostic: (request: Readonly<GetConnectivityDiagnosticRequest>) => Promise<ConnectivityDiagnostic>;
123
125
  }
@@ -4,7 +4,7 @@ import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
4
4
  import "../../../vendor/base64/index.js";
5
5
  import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
6
6
  import { SERVER_TRANSIENT_STATUSES } from "./content.gen.js";
7
- import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, unmarshalListServersResponse, unmarshalListOSResponse, unmarshalOS, marshalUpdateServerRequest, marshalReinstallServerRequest } from "./marshalling.gen.js";
7
+ import { unmarshalListServerTypesResponse, unmarshalServerType, marshalCreateServerRequest, unmarshalServer, unmarshalListServersResponse, unmarshalListOSResponse, unmarshalOS, marshalUpdateServerRequest, marshalReinstallServerRequest, marshalStartConnectivityDiagnosticRequest, unmarshalStartConnectivityDiagnosticResponse, unmarshalConnectivityDiagnostic } from "./marshalling.gen.js";
8
8
  const jsonContentHeaders = {
9
9
  "Content-Type": "application/json; charset=utf-8"
10
10
  };
@@ -217,6 +217,27 @@ class API extends API$1 {
217
217
  },
218
218
  unmarshalServer
219
219
  );
220
+ startConnectivityDiagnostic = (request) => this.client.fetch(
221
+ {
222
+ body: JSON.stringify(
223
+ marshalStartConnectivityDiagnosticRequest(
224
+ request,
225
+ this.client.settings
226
+ )
227
+ ),
228
+ headers: jsonContentHeaders,
229
+ method: "POST",
230
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics`
231
+ },
232
+ unmarshalStartConnectivityDiagnosticResponse
233
+ );
234
+ getConnectivityDiagnostic = (request) => this.client.fetch(
235
+ {
236
+ method: "GET",
237
+ path: `/apple-silicon/v1alpha1/zones/${validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/connectivity-diagnostics/${validatePathParam("diagnosticId", request.diagnosticId)}`
238
+ },
239
+ unmarshalConnectivityDiagnostic
240
+ );
220
241
  }
221
242
  export {
222
243
  API
@@ -1,3 +1,3 @@
1
1
  export { API } from './api.gen';
2
2
  export * from './content.gen';
3
- export type { CreateServerRequest, DeleteServerRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, OS, RebootServerRequest, ReinstallServerRequest, Server, ServerStatus, ServerType, ServerTypeCPU, ServerTypeDisk, ServerTypeGPU, ServerTypeMemory, ServerTypeNetwork, ServerTypeStock, UpdateServerRequest, } from './types.gen';
3
+ export type { ConnectivityDiagnostic, ConnectivityDiagnosticActionType, ConnectivityDiagnosticDiagnosticStatus, ConnectivityDiagnosticServerHealth, CreateServerRequest, DeleteServerRequest, GetConnectivityDiagnosticRequest, GetOSRequest, GetServerRequest, GetServerTypeRequest, ListOSRequest, ListOSResponse, ListServerTypesRequest, ListServerTypesResponse, ListServersRequest, ListServersRequestOrderBy, ListServersResponse, OS, RebootServerRequest, ReinstallServerRequest, Server, ServerStatus, ServerType, ServerTypeCPU, ServerTypeDisk, ServerTypeGPU, ServerTypeMemory, ServerTypeNetwork, ServerTypeStock, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest, } from './types.gen';
@@ -121,6 +121,36 @@ const unmarshalServer = (data) => {
121
121
  zone: data.zone
122
122
  };
123
123
  };
124
+ const unmarshalConnectivityDiagnosticServerHealth = (data) => {
125
+ if (!json.isJSONObject(data)) {
126
+ throw new TypeError(
127
+ `Unmarshalling the type 'ConnectivityDiagnosticServerHealth' failed as data isn't a dictionary.`
128
+ );
129
+ }
130
+ return {
131
+ isAgentAlive: data.is_agent_alive,
132
+ isMdmAlive: data.is_mdm_alive,
133
+ isServerAlive: data.is_server_alive,
134
+ isSshPortUp: data.is_ssh_port_up,
135
+ isVncPortUp: data.is_vnc_port_up,
136
+ lastCheckinDate: marshalling.unmarshalDate(data.last_checkin_date)
137
+ };
138
+ };
139
+ const unmarshalConnectivityDiagnostic = (data) => {
140
+ if (!json.isJSONObject(data)) {
141
+ throw new TypeError(
142
+ `Unmarshalling the type 'ConnectivityDiagnostic' failed as data isn't a dictionary.`
143
+ );
144
+ }
145
+ return {
146
+ errorMessage: data.error_message,
147
+ healthDetails: data.health_details ? unmarshalConnectivityDiagnosticServerHealth(data.health_details) : void 0,
148
+ id: data.id,
149
+ isHealthy: data.is_healthy,
150
+ status: data.status,
151
+ supportedActions: data.supported_actions
152
+ };
153
+ };
124
154
  const unmarshalListOSResponse = (data) => {
125
155
  if (!json.isJSONObject(data)) {
126
156
  throw new TypeError(
@@ -153,6 +183,16 @@ const unmarshalListServersResponse = (data) => {
153
183
  totalCount: data.total_count
154
184
  };
155
185
  };
186
+ const unmarshalStartConnectivityDiagnosticResponse = (data) => {
187
+ if (!json.isJSONObject(data)) {
188
+ throw new TypeError(
189
+ `Unmarshalling the type 'StartConnectivityDiagnosticResponse' failed as data isn't a dictionary.`
190
+ );
191
+ }
192
+ return {
193
+ diagnosticId: data.diagnostic_id
194
+ };
195
+ };
156
196
  const marshalCreateServerRequest = (request, defaults) => ({
157
197
  name: request.name || randomName("as"),
158
198
  os_id: request.osId,
@@ -162,16 +202,22 @@ const marshalCreateServerRequest = (request, defaults) => ({
162
202
  const marshalReinstallServerRequest = (request, defaults) => ({
163
203
  os_id: request.osId
164
204
  });
205
+ const marshalStartConnectivityDiagnosticRequest = (request, defaults) => ({
206
+ server_id: request.serverId
207
+ });
165
208
  const marshalUpdateServerRequest = (request, defaults) => ({
166
209
  name: request.name,
167
210
  schedule_deletion: request.scheduleDeletion
168
211
  });
169
212
  exports.marshalCreateServerRequest = marshalCreateServerRequest;
170
213
  exports.marshalReinstallServerRequest = marshalReinstallServerRequest;
214
+ exports.marshalStartConnectivityDiagnosticRequest = marshalStartConnectivityDiagnosticRequest;
171
215
  exports.marshalUpdateServerRequest = marshalUpdateServerRequest;
216
+ exports.unmarshalConnectivityDiagnostic = unmarshalConnectivityDiagnostic;
172
217
  exports.unmarshalListOSResponse = unmarshalListOSResponse;
173
218
  exports.unmarshalListServerTypesResponse = unmarshalListServerTypesResponse;
174
219
  exports.unmarshalListServersResponse = unmarshalListServersResponse;
175
220
  exports.unmarshalOS = unmarshalOS;
176
221
  exports.unmarshalServer = unmarshalServer;
177
222
  exports.unmarshalServerType = unmarshalServerType;
223
+ exports.unmarshalStartConnectivityDiagnosticResponse = unmarshalStartConnectivityDiagnosticResponse;
@@ -1,11 +1,14 @@
1
1
  import type { DefaultValues } from '../../../bridge';
2
- import type { CreateServerRequest, ListOSResponse, ListServerTypesResponse, ListServersResponse, OS, ReinstallServerRequest, Server, ServerType, UpdateServerRequest } from './types.gen';
2
+ import type { ConnectivityDiagnostic, CreateServerRequest, ListOSResponse, ListServerTypesResponse, ListServersResponse, OS, ReinstallServerRequest, Server, ServerType, StartConnectivityDiagnosticRequest, StartConnectivityDiagnosticResponse, UpdateServerRequest } from './types.gen';
3
3
  export declare const unmarshalOS: (data: unknown) => OS;
4
4
  export declare const unmarshalServerType: (data: unknown) => ServerType;
5
5
  export declare const unmarshalServer: (data: unknown) => Server;
6
+ export declare const unmarshalConnectivityDiagnostic: (data: unknown) => ConnectivityDiagnostic;
6
7
  export declare const unmarshalListOSResponse: (data: unknown) => ListOSResponse;
7
8
  export declare const unmarshalListServerTypesResponse: (data: unknown) => ListServerTypesResponse;
8
9
  export declare const unmarshalListServersResponse: (data: unknown) => ListServersResponse;
10
+ export declare const unmarshalStartConnectivityDiagnosticResponse: (data: unknown) => StartConnectivityDiagnosticResponse;
9
11
  export declare const marshalCreateServerRequest: (request: CreateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
10
12
  export declare const marshalReinstallServerRequest: (request: ReinstallServerRequest, defaults: DefaultValues) => Record<string, unknown>;
13
+ export declare const marshalStartConnectivityDiagnosticRequest: (request: StartConnectivityDiagnosticRequest, defaults: DefaultValues) => Record<string, unknown>;
11
14
  export declare const marshalUpdateServerRequest: (request: UpdateServerRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -119,6 +119,36 @@ const unmarshalServer = (data) => {
119
119
  zone: data.zone
120
120
  };
121
121
  };
122
+ const unmarshalConnectivityDiagnosticServerHealth = (data) => {
123
+ if (!isJSONObject(data)) {
124
+ throw new TypeError(
125
+ `Unmarshalling the type 'ConnectivityDiagnosticServerHealth' failed as data isn't a dictionary.`
126
+ );
127
+ }
128
+ return {
129
+ isAgentAlive: data.is_agent_alive,
130
+ isMdmAlive: data.is_mdm_alive,
131
+ isServerAlive: data.is_server_alive,
132
+ isSshPortUp: data.is_ssh_port_up,
133
+ isVncPortUp: data.is_vnc_port_up,
134
+ lastCheckinDate: unmarshalDate(data.last_checkin_date)
135
+ };
136
+ };
137
+ const unmarshalConnectivityDiagnostic = (data) => {
138
+ if (!isJSONObject(data)) {
139
+ throw new TypeError(
140
+ `Unmarshalling the type 'ConnectivityDiagnostic' failed as data isn't a dictionary.`
141
+ );
142
+ }
143
+ return {
144
+ errorMessage: data.error_message,
145
+ healthDetails: data.health_details ? unmarshalConnectivityDiagnosticServerHealth(data.health_details) : void 0,
146
+ id: data.id,
147
+ isHealthy: data.is_healthy,
148
+ status: data.status,
149
+ supportedActions: data.supported_actions
150
+ };
151
+ };
122
152
  const unmarshalListOSResponse = (data) => {
123
153
  if (!isJSONObject(data)) {
124
154
  throw new TypeError(
@@ -151,6 +181,16 @@ const unmarshalListServersResponse = (data) => {
151
181
  totalCount: data.total_count
152
182
  };
153
183
  };
184
+ const unmarshalStartConnectivityDiagnosticResponse = (data) => {
185
+ if (!isJSONObject(data)) {
186
+ throw new TypeError(
187
+ `Unmarshalling the type 'StartConnectivityDiagnosticResponse' failed as data isn't a dictionary.`
188
+ );
189
+ }
190
+ return {
191
+ diagnosticId: data.diagnostic_id
192
+ };
193
+ };
154
194
  const marshalCreateServerRequest = (request, defaults) => ({
155
195
  name: request.name || randomName("as"),
156
196
  os_id: request.osId,
@@ -160,6 +200,9 @@ const marshalCreateServerRequest = (request, defaults) => ({
160
200
  const marshalReinstallServerRequest = (request, defaults) => ({
161
201
  os_id: request.osId
162
202
  });
203
+ const marshalStartConnectivityDiagnosticRequest = (request, defaults) => ({
204
+ server_id: request.serverId
205
+ });
163
206
  const marshalUpdateServerRequest = (request, defaults) => ({
164
207
  name: request.name,
165
208
  schedule_deletion: request.scheduleDeletion
@@ -167,11 +210,14 @@ const marshalUpdateServerRequest = (request, defaults) => ({
167
210
  export {
168
211
  marshalCreateServerRequest,
169
212
  marshalReinstallServerRequest,
213
+ marshalStartConnectivityDiagnosticRequest,
170
214
  marshalUpdateServerRequest,
215
+ unmarshalConnectivityDiagnostic,
171
216
  unmarshalListOSResponse,
172
217
  unmarshalListServerTypesResponse,
173
218
  unmarshalListServersResponse,
174
219
  unmarshalOS,
175
220
  unmarshalServer,
176
- unmarshalServerType
221
+ unmarshalServerType,
222
+ unmarshalStartConnectivityDiagnosticResponse
177
223
  };
@@ -1,4 +1,6 @@
1
1
  import type { Zone } from '../../../bridge';
2
+ export type ConnectivityDiagnosticActionType = 'reboot_server' | 'reinstall_server';
3
+ export type ConnectivityDiagnosticDiagnosticStatus = 'unknown_status' | 'processing' | 'error' | 'completed';
2
4
  export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc';
3
5
  export type ServerStatus = 'unknown_status' | 'starting' | 'ready' | 'error' | 'rebooting' | 'updating' | 'locking' | 'locked' | 'unlocking' | 'reinstalling';
4
6
  export type ServerTypeStock = 'unknown_stock' | 'no_stock' | 'low_stock' | 'high_stock';
@@ -41,6 +43,14 @@ export interface ServerTypeMemory {
41
43
  export interface ServerTypeNetwork {
42
44
  publicBandwidthBps: number;
43
45
  }
46
+ export interface ConnectivityDiagnosticServerHealth {
47
+ lastCheckinDate?: Date;
48
+ isServerAlive: boolean;
49
+ isAgentAlive: boolean;
50
+ isMdmAlive: boolean;
51
+ isSshPortUp: boolean;
52
+ isVncPortUp: boolean;
53
+ }
44
54
  export interface ServerType {
45
55
  /** CPU description. */
46
56
  cpu?: ServerTypeCPU;
@@ -112,6 +122,14 @@ export interface Server {
112
122
  */
113
123
  delivered: boolean;
114
124
  }
125
+ export interface ConnectivityDiagnostic {
126
+ id: string;
127
+ status: ConnectivityDiagnosticDiagnosticStatus;
128
+ isHealthy: boolean;
129
+ healthDetails?: ConnectivityDiagnosticServerHealth;
130
+ supportedActions: ConnectivityDiagnosticActionType[];
131
+ errorMessage: string;
132
+ }
115
133
  export type CreateServerRequest = {
116
134
  /** Zone to target. If none is passed will use default zone from the config. */
117
135
  zone?: Zone;
@@ -134,6 +152,11 @@ export type DeleteServerRequest = {
134
152
  /** UUID of the server you want to delete. */
135
153
  serverId: string;
136
154
  };
155
+ export type GetConnectivityDiagnosticRequest = {
156
+ /** Zone to target. If none is passed will use default zone from the config. */
157
+ zone?: Zone;
158
+ diagnosticId: string;
159
+ };
137
160
  export type GetOSRequest = {
138
161
  /** Zone to target. If none is passed will use default zone from the config. */
139
162
  zone?: Zone;
@@ -224,6 +247,14 @@ export type ReinstallServerRequest = {
224
247
  */
225
248
  osId?: string;
226
249
  };
250
+ export type StartConnectivityDiagnosticRequest = {
251
+ /** Zone to target. If none is passed will use default zone from the config. */
252
+ zone?: Zone;
253
+ serverId: string;
254
+ };
255
+ export interface StartConnectivityDiagnosticResponse {
256
+ diagnosticId: string;
257
+ }
227
258
  export type UpdateServerRequest = {
228
259
  /** Zone to target. If none is passed will use default zone from the config. */
229
260
  zone?: Zone;
@@ -59,7 +59,8 @@ class API extends api.API {
59
59
  request.pageSize ?? this.client.settings.defaultPageSize
60
60
  ],
61
61
  ["product_resource_id", request.productResourceId],
62
- ["project_id", request.projectId]
62
+ ["project_id", request.projectId],
63
+ ["tags", request.tags]
63
64
  )
64
65
  },
65
66
  marshalling_gen.unmarshalListVolumesResponse
@@ -84,7 +85,7 @@ class API extends api.API {
84
85
  * @param request - The request {@link CreateVolumeRequest}
85
86
  * @returns A Promise of Volume
86
87
  */
87
- createVolume = (request) => this.client.fetch(
88
+ createVolume = (request = {}) => this.client.fetch(
88
89
  {
89
90
  body: JSON.stringify(
90
91
  marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings)
@@ -45,7 +45,7 @@ export declare class API extends ParentAPI {
45
45
  * @param request - The request {@link CreateVolumeRequest}
46
46
  * @returns A Promise of Volume
47
47
  */
48
- createVolume: (request: Readonly<CreateVolumeRequest>) => Promise<Volume>;
48
+ createVolume: (request?: Readonly<CreateVolumeRequest>) => Promise<Volume>;
49
49
  /**
50
50
  * Get a volume. Retrieve technical information about a specific volume.
51
51
  * Details such as size, type, and status are returned in the response.
@@ -57,7 +57,8 @@ class API extends API$1 {
57
57
  request.pageSize ?? this.client.settings.defaultPageSize
58
58
  ],
59
59
  ["product_resource_id", request.productResourceId],
60
- ["project_id", request.projectId]
60
+ ["project_id", request.projectId],
61
+ ["tags", request.tags]
61
62
  )
62
63
  },
63
64
  unmarshalListVolumesResponse
@@ -82,7 +83,7 @@ class API extends API$1 {
82
83
  * @param request - The request {@link CreateVolumeRequest}
83
84
  * @returns A Promise of Volume
84
85
  */
85
- createVolume = (request) => this.client.fetch(
86
+ createVolume = (request = {}) => this.client.fetch(
86
87
  {
87
88
  body: JSON.stringify(
88
89
  marshalCreateVolumeRequest(request, this.client.settings)
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const randomName = require("@scaleway/random-name");
3
4
  const json = require("../../../helpers/json.cjs");
4
5
  const customMarshalling = require("../../../scw/custom-marshalling.cjs");
5
6
  const marshalling = require("../../../helpers/marshalling.cjs");
@@ -133,7 +134,7 @@ const unmarshalListVolumesResponse = (data) => {
133
134
  };
134
135
  };
135
136
  const marshalCreateSnapshotRequest = (request, defaults) => ({
136
- name: request.name,
137
+ name: request.name || randomName("snp"),
137
138
  project_id: request.projectId ?? defaults.defaultProjectId,
138
139
  tags: request.tags,
139
140
  volume_id: request.volumeId
@@ -146,7 +147,7 @@ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
146
147
  snapshot_id: request.snapshotId
147
148
  });
148
149
  const marshalCreateVolumeRequest = (request, defaults) => ({
149
- name: request.name,
150
+ name: request.name || randomName("vol"),
150
151
  project_id: request.projectId ?? defaults.defaultProjectId,
151
152
  tags: request.tags,
152
153
  ...marshalling.resolveOneOf([
@@ -1,3 +1,4 @@
1
+ import randomName from "@scaleway/random-name";
1
2
  import { isJSONObject } from "../../../helpers/json.js";
2
3
  import { unmarshalMoney } from "../../../scw/custom-marshalling.js";
3
4
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
@@ -131,7 +132,7 @@ const unmarshalListVolumesResponse = (data) => {
131
132
  };
132
133
  };
133
134
  const marshalCreateSnapshotRequest = (request, defaults) => ({
134
- name: request.name,
135
+ name: request.name || randomName("snp"),
135
136
  project_id: request.projectId ?? defaults.defaultProjectId,
136
137
  tags: request.tags,
137
138
  volume_id: request.volumeId
@@ -144,7 +145,7 @@ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
144
145
  snapshot_id: request.snapshotId
145
146
  });
146
147
  const marshalCreateVolumeRequest = (request, defaults) => ({
147
- name: request.name,
148
+ name: request.name || randomName("vol"),
148
149
  project_id: request.projectId ?? defaults.defaultProjectId,
149
150
  tags: request.tags,
150
151
  ...resolveOneOf([
@@ -134,7 +134,7 @@ export type CreateSnapshotRequest = {
134
134
  /** UUID of the volume to snapshot. */
135
135
  volumeId: string;
136
136
  /** Name of the snapshot. */
137
- name: string;
137
+ name?: string;
138
138
  /** UUID of the project to which the volume and the snapshot belong. */
139
139
  projectId?: string;
140
140
  /** List of tags assigned to the snapshot. */
@@ -144,7 +144,7 @@ export type CreateVolumeRequest = {
144
144
  /** Zone to target. If none is passed will use default zone from the config. */
145
145
  zone?: Zone;
146
146
  /** Name of the volume. */
147
- name: string;
147
+ name?: string;
148
148
  /**
149
149
  * The maximum IO/s expected, according to the different options available in
150
150
  * stock (`5000 | 15000`).
@@ -302,6 +302,11 @@ export type ListVolumesRequest = {
302
302
  * ID).
303
303
  */
304
304
  productResourceId?: string;
305
+ /**
306
+ * Filter by tags. Only volumes with one or more matching tags will be
307
+ * returned.
308
+ */
309
+ tags?: string[];
305
310
  };
306
311
  export interface ListVolumesResponse {
307
312
  /** Paginated returned list of volumes. */
@@ -207,7 +207,9 @@ class GlobalAPI extends api.API {
207
207
  );
208
208
  /**
209
209
  * List plan types. Retrieve a list of available pricing plan types.
210
+ * Deprecated, retention is now managed at the data source level.
210
211
  *
212
+ * @deprecated
211
213
  * @param request - The request {@link GlobalApiListPlansRequest}
212
214
  * @returns A Promise of ListPlansResponse
213
215
  */
@@ -215,8 +217,10 @@ class GlobalAPI extends api.API {
215
217
  /**
216
218
  * Apply a pricing plan. Apply a pricing plan on a given Project. You must
217
219
  * specify the ID of the pricing plan type. Note that you will be billed for
218
- * the plan you apply.
220
+ * the plan you apply. Deprecated, retention is now managed at the data source
221
+ * level.
219
222
  *
223
+ * @deprecated
220
224
  * @param request - The request {@link GlobalApiSelectPlanRequest}
221
225
  * @returns A Promise of Plan
222
226
  */
@@ -233,8 +237,10 @@ class GlobalAPI extends api.API {
233
237
  );
234
238
  /**
235
239
  * Get current plan. Retrieve a pricing plan for the given Project, specified
236
- * by the ID of the Project.
240
+ * by the ID of the Project. Deprecated, retention is now managed at the data
241
+ * source level.
237
242
  *
243
+ * @deprecated
238
244
  * @param request - The request {@link GlobalApiGetCurrentPlanRequest}
239
245
  * @returns A Promise of Plan
240
246
  */
@@ -253,6 +259,19 @@ class GlobalAPI extends api.API {
253
259
  class RegionalAPI extends api.API {
254
260
  /** Lists the available regions of the API. */
255
261
  static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
262
+ /**
263
+ * Get the Cockpit configuration.
264
+ *
265
+ * @param request - The request {@link RegionalApiGetConfigRequest}
266
+ * @returns A Promise of GetConfigResponse
267
+ */
268
+ getConfig = (request = {}) => this.client.fetch(
269
+ {
270
+ method: "GET",
271
+ path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/config`
272
+ },
273
+ marshalling_gen.unmarshalGetConfigResponse
274
+ );
256
275
  /**
257
276
  * Create a data source. You must specify the data source type upon creation.
258
277
  * Available data source types include:
@@ -1,6 +1,6 @@
1
1
  import { API as ParentAPI } from '../../../bridge';
2
2
  import type { Region } from '../../../bridge';
3
- import type { AlertManager, ContactPoint, DataSource, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListManagedAlertsResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListManagedAlertsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateDataSourceRequest, Token, UsageOverview } from './types.gen';
3
+ import type { AlertManager, ContactPoint, DataSource, GetConfigResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListManagedAlertsResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListManagedAlertsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateDataSourceRequest, Token, UsageOverview } from './types.gen';
4
4
  /**
5
5
  * Cockpit Global API.
6
6
  *
@@ -94,7 +94,9 @@ export declare class GlobalAPI extends ParentAPI {
94
94
  protected pageOfListPlans: (request?: Readonly<GlobalApiListPlansRequest>) => Promise<ListPlansResponse>;
95
95
  /**
96
96
  * List plan types. Retrieve a list of available pricing plan types.
97
+ * Deprecated, retention is now managed at the data source level.
97
98
  *
99
+ * @deprecated
98
100
  * @param request - The request {@link GlobalApiListPlansRequest}
99
101
  * @returns A Promise of ListPlansResponse
100
102
  */
@@ -105,16 +107,20 @@ export declare class GlobalAPI extends ParentAPI {
105
107
  /**
106
108
  * Apply a pricing plan. Apply a pricing plan on a given Project. You must
107
109
  * specify the ID of the pricing plan type. Note that you will be billed for
108
- * the plan you apply.
110
+ * the plan you apply. Deprecated, retention is now managed at the data source
111
+ * level.
109
112
  *
113
+ * @deprecated
110
114
  * @param request - The request {@link GlobalApiSelectPlanRequest}
111
115
  * @returns A Promise of Plan
112
116
  */
113
117
  selectPlan: (request?: Readonly<GlobalApiSelectPlanRequest>) => Promise<Plan>;
114
118
  /**
115
119
  * Get current plan. Retrieve a pricing plan for the given Project, specified
116
- * by the ID of the Project.
120
+ * by the ID of the Project. Deprecated, retention is now managed at the data
121
+ * source level.
117
122
  *
123
+ * @deprecated
118
124
  * @param request - The request {@link GlobalApiGetCurrentPlanRequest}
119
125
  * @returns A Promise of Plan
120
126
  */
@@ -131,6 +137,13 @@ export declare class GlobalAPI extends ParentAPI {
131
137
  export declare class RegionalAPI extends ParentAPI {
132
138
  /** Lists the available regions of the API. */
133
139
  static readonly LOCALITIES: Region[];
140
+ /**
141
+ * Get the Cockpit configuration.
142
+ *
143
+ * @param request - The request {@link RegionalApiGetConfigRequest}
144
+ * @returns A Promise of GetConfigResponse
145
+ */
146
+ getConfig: (request?: Readonly<RegionalApiGetConfigRequest>) => Promise<GetConfigResponse>;
134
147
  /**
135
148
  * Create a data source. You must specify the data source type upon creation.
136
149
  * Available data source types include:
@@ -2,7 +2,7 @@ import { API as API$1 } from "../../../scw/api.js";
2
2
  import { urlParams, validatePathParam } from "../../../helpers/marshalling.js";
3
3
  import "../../../vendor/base64/index.js";
4
4
  import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
5
- import { unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, marshalRegionalApiUpdateDataSourceRequest, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiDeleteContactPointRequest, unmarshalListManagedAlertsResponse, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest } from "./marshalling.gen.js";
5
+ import { unmarshalGrafana, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalGlobalApiCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalGlobalApiResetGrafanaUserPasswordRequest, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard, unmarshalListPlansResponse, marshalGlobalApiSelectPlanRequest, unmarshalPlan, unmarshalGetConfigResponse, marshalRegionalApiCreateDataSourceRequest, unmarshalDataSource, unmarshalListDataSourcesResponse, marshalRegionalApiUpdateDataSourceRequest, unmarshalUsageOverview, marshalRegionalApiCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, unmarshalAlertManager, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalRegionalApiDeleteContactPointRequest, unmarshalListManagedAlertsResponse, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest } from "./marshalling.gen.js";
6
6
  const jsonContentHeaders = {
7
7
  "Content-Type": "application/json; charset=utf-8"
8
8
  };
@@ -205,7 +205,9 @@ class GlobalAPI extends API$1 {
205
205
  );
206
206
  /**
207
207
  * List plan types. Retrieve a list of available pricing plan types.
208
+ * Deprecated, retention is now managed at the data source level.
208
209
  *
210
+ * @deprecated
209
211
  * @param request - The request {@link GlobalApiListPlansRequest}
210
212
  * @returns A Promise of ListPlansResponse
211
213
  */
@@ -213,8 +215,10 @@ class GlobalAPI extends API$1 {
213
215
  /**
214
216
  * Apply a pricing plan. Apply a pricing plan on a given Project. You must
215
217
  * specify the ID of the pricing plan type. Note that you will be billed for
216
- * the plan you apply.
218
+ * the plan you apply. Deprecated, retention is now managed at the data source
219
+ * level.
217
220
  *
221
+ * @deprecated
218
222
  * @param request - The request {@link GlobalApiSelectPlanRequest}
219
223
  * @returns A Promise of Plan
220
224
  */
@@ -231,8 +235,10 @@ class GlobalAPI extends API$1 {
231
235
  );
232
236
  /**
233
237
  * Get current plan. Retrieve a pricing plan for the given Project, specified
234
- * by the ID of the Project.
238
+ * by the ID of the Project. Deprecated, retention is now managed at the data
239
+ * source level.
235
240
  *
241
+ * @deprecated
236
242
  * @param request - The request {@link GlobalApiGetCurrentPlanRequest}
237
243
  * @returns A Promise of Plan
238
244
  */
@@ -251,6 +257,19 @@ class GlobalAPI extends API$1 {
251
257
  class RegionalAPI extends API$1 {
252
258
  /** Lists the available regions of the API. */
253
259
  static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
260
+ /**
261
+ * Get the Cockpit configuration.
262
+ *
263
+ * @param request - The request {@link RegionalApiGetConfigRequest}
264
+ * @returns A Promise of GetConfigResponse
265
+ */
266
+ getConfig = (request = {}) => this.client.fetch(
267
+ {
268
+ method: "GET",
269
+ path: `/cockpit/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/config`
270
+ },
271
+ unmarshalGetConfigResponse
272
+ );
254
273
  /**
255
274
  * Create a data source. You must specify the data source type upon creation.
256
275
  * Available data source types include:
@@ -1,3 +1,3 @@
1
1
  export { GlobalAPI, RegionalAPI } from './api.gen';
2
- export type { Alert, AlertManager, ContactPoint, ContactPointEmail, DataSource, DataSourceOrigin, DataSourceType, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, GrafanaUserRole, ListContactPointsResponse, ListDataSourcesRequestOrderBy, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersRequestOrderBy, ListGrafanaUsersResponse, ListManagedAlertsRequestOrderBy, ListManagedAlertsResponse, ListPlansRequestOrderBy, ListPlansResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListManagedAlertsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateDataSourceRequest, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.gen';
2
+ export type { Alert, AlertManager, ContactPoint, ContactPointEmail, DataSource, DataSourceOrigin, DataSourceType, GetConfigResponse, GetConfigResponseRetention, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, GrafanaUserRole, ListContactPointsResponse, ListDataSourcesRequestOrderBy, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersRequestOrderBy, ListGrafanaUsersResponse, ListManagedAlertsRequestOrderBy, ListManagedAlertsResponse, ListPlansRequestOrderBy, ListPlansResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListManagedAlertsRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateDataSourceRequest, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.gen';
3
3
  export * as ValidationRules from './validation-rules.gen';