@scaleway/sdk-datawarehouse 2.1.1 → 2.3.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.
@@ -1,6 +1,6 @@
1
1
  import type { ApiLocality, WaitForOptions } from '@scaleway/sdk-client';
2
2
  import { API as ParentAPI } from '@scaleway/sdk-client';
3
- import type { CreateDatabaseRequest, CreateDeploymentRequest, CreateEndpointRequest, CreateUserRequest, Database, DeleteDatabaseRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteUserRequest, Deployment, Endpoint, GetDeploymentCertificateRequest, GetDeploymentRequest, ListDatabasesRequest, ListDatabasesResponse, ListDeploymentsRequest, ListDeploymentsResponse, ListPresetsRequest, ListPresetsResponse, ListUsersRequest, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, UpdateDeploymentRequest, UpdateUserRequest, User } from './types.gen.js';
3
+ import type { CreateDatabaseRequest, CreateDeploymentRequest, CreateEndpointRequest, CreateUserRequest, Database, DeleteDatabaseRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteUserRequest, Deployment, Endpoint, GetDeploymentCertificateRequest, GetDeploymentRequest, ListDatabasesRequest, ListDatabasesResponse, ListDeploymentsRequest, ListDeploymentsResponse, ListPresetsRequest, ListPresetsResponse, ListUsersRequest, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, StartDeploymentRequest, StopDeploymentRequest, UpdateDeploymentRequest, UpdateUserRequest, User } from './types.gen.js';
4
4
  /**
5
5
  * Data Warehouse API.
6
6
 
@@ -81,7 +81,27 @@ export declare class API extends ParentAPI {
81
81
  * @returns A Promise of Deployment
82
82
  */
83
83
  deleteDeployment: (request: Readonly<DeleteDeploymentRequest>) => Promise<Deployment>;
84
+ /**
85
+ * Get deployment TLS certificate. Retrieve the TLS certificate associated with a deployment.
86
+ *
87
+ * @param request - The request {@link GetDeploymentCertificateRequest}
88
+ * @returns A Promise of Blob
89
+ */
84
90
  getDeploymentCertificate: (request: Readonly<GetDeploymentCertificateRequest>) => Promise<Blob>;
91
+ /**
92
+ * Start a deployment. Start a stopped deployment.
93
+ *
94
+ * @param request - The request {@link StartDeploymentRequest}
95
+ * @returns A Promise of Deployment
96
+ */
97
+ startDeployment: (request: Readonly<StartDeploymentRequest>) => Promise<Deployment>;
98
+ /**
99
+ * Stop a deployment. Stop a running deployment.
100
+ *
101
+ * @param request - The request {@link StopDeploymentRequest}
102
+ * @returns A Promise of Deployment
103
+ */
104
+ stopDeployment: (request: Readonly<StopDeploymentRequest>) => Promise<Deployment>;
85
105
  protected pageOfListUsers: (request: Readonly<ListUsersRequest>) => Promise<ListUsersResponse>;
86
106
  /**
87
107
  * List users associated with a deployment.
@@ -10,9 +10,7 @@ class API extends API$1 {
10
10
  * type ∈ {'zone','region','global','unspecified'}
11
11
  */
12
12
  static LOCALITY = toApiLocality({
13
- regions: [
14
- "fr-par"
15
- ]
13
+ regions: ["fr-par"]
16
14
  });
17
15
  pageOfListPresets = (request = {}) => this.client.fetch(
18
16
  {
@@ -20,7 +18,10 @@ class API extends API$1 {
20
18
  path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/presets`,
21
19
  urlParams: urlParams(
22
20
  ["page", request.page],
23
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
21
+ [
22
+ "page_size",
23
+ request.pageSize ?? this.client.settings.defaultPageSize
24
+ ]
24
25
  )
25
26
  },
26
27
  unmarshalListPresetsResponse
@@ -38,7 +39,10 @@ class API extends API$1 {
38
39
  path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
39
40
  urlParams: urlParams(
40
41
  ["page", request.page],
41
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
42
+ [
43
+ "page_size",
44
+ request.pageSize ?? this.client.settings.defaultPageSize
45
+ ],
42
46
  ["version", request.version]
43
47
  )
44
48
  },
@@ -60,7 +64,10 @@ class API extends API$1 {
60
64
  ["order_by", request.orderBy],
61
65
  ["organization_id", request.organizationId],
62
66
  ["page", request.page],
63
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
67
+ [
68
+ "page_size",
69
+ request.pageSize ?? this.client.settings.defaultPageSize
70
+ ],
64
71
  ["project_id", request.projectId],
65
72
  ["tags", request.tags]
66
73
  )
@@ -95,7 +102,9 @@ class API extends API$1 {
95
102
  * @returns A Promise of Deployment
96
103
  */
97
104
  waitForDeployment = (request, options) => waitForResource(
98
- options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))),
105
+ options?.stop ?? ((res) => Promise.resolve(
106
+ !DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status)
107
+ )),
99
108
  this.getDeployment,
100
109
  request,
101
110
  options
@@ -147,15 +156,47 @@ class API extends API$1 {
147
156
  },
148
157
  unmarshalDeployment
149
158
  );
150
- getDeploymentCertificate = (request) => this.client.fetch(
159
+ /**
160
+ * Get deployment TLS certificate. Retrieve the TLS certificate associated with a deployment.
161
+ *
162
+ * @param request - The request {@link GetDeploymentCertificateRequest}
163
+ * @returns A Promise of Blob
164
+ */
165
+ getDeploymentCertificate = (request) => this.client.fetch({
166
+ method: "GET",
167
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
168
+ urlParams: urlParams(["dl", 1]),
169
+ responseType: "blob"
170
+ });
171
+ /**
172
+ * Start a deployment. Start a stopped deployment.
173
+ *
174
+ * @param request - The request {@link StartDeploymentRequest}
175
+ * @returns A Promise of Deployment
176
+ */
177
+ startDeployment = (request) => this.client.fetch(
151
178
  {
152
- method: "GET",
153
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
154
- urlParams: urlParams(
155
- ["dl", 1]
156
- ),
157
- responseType: "blob"
158
- }
179
+ body: "{}",
180
+ headers: jsonContentHeaders,
181
+ method: "POST",
182
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/start`
183
+ },
184
+ unmarshalDeployment
185
+ );
186
+ /**
187
+ * Stop a deployment. Stop a running deployment.
188
+ *
189
+ * @param request - The request {@link StopDeploymentRequest}
190
+ * @returns A Promise of Deployment
191
+ */
192
+ stopDeployment = (request) => this.client.fetch(
193
+ {
194
+ body: "{}",
195
+ headers: jsonContentHeaders,
196
+ method: "POST",
197
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/stop`
198
+ },
199
+ unmarshalDeployment
159
200
  );
160
201
  pageOfListUsers = (request) => this.client.fetch(
161
202
  {
@@ -165,7 +206,10 @@ class API extends API$1 {
165
206
  ["name", request.name],
166
207
  ["order_by", request.orderBy],
167
208
  ["page", request.page],
168
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
209
+ [
210
+ "page_size",
211
+ request.pageSize ?? this.client.settings.defaultPageSize
212
+ ]
169
213
  )
170
214
  },
171
215
  unmarshalListUsersResponse
@@ -216,25 +260,21 @@ class API extends API$1 {
216
260
  *
217
261
  * @param request - The request {@link DeleteUserRequest}
218
262
  */
219
- deleteUser = (request) => this.client.fetch(
220
- {
221
- body: "{}",
222
- headers: jsonContentHeaders,
223
- method: "DELETE",
224
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users/${validatePathParam("name", request.name)}`
225
- }
226
- );
263
+ deleteUser = (request) => this.client.fetch({
264
+ body: "{}",
265
+ headers: jsonContentHeaders,
266
+ method: "DELETE",
267
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users/${validatePathParam("name", request.name)}`
268
+ });
227
269
  /**
228
270
  * Delete an endpoint from a deployment.
229
271
  *
230
272
  * @param request - The request {@link DeleteEndpointRequest}
231
273
  */
232
- deleteEndpoint = (request) => this.client.fetch(
233
- {
234
- method: "DELETE",
235
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
236
- }
237
- );
274
+ deleteEndpoint = (request) => this.client.fetch({
275
+ method: "DELETE",
276
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
277
+ });
238
278
  /**
239
279
  * Create a new endpoint for a deployment.
240
280
  *
@@ -260,7 +300,10 @@ class API extends API$1 {
260
300
  ["name", request.name],
261
301
  ["order_by", request.orderBy],
262
302
  ["page", request.page],
263
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
303
+ [
304
+ "page_size",
305
+ request.pageSize ?? this.client.settings.defaultPageSize
306
+ ]
264
307
  )
265
308
  },
266
309
  unmarshalListDatabasesResponse
@@ -294,12 +337,10 @@ class API extends API$1 {
294
337
  *
295
338
  * @param request - The request {@link DeleteDatabaseRequest}
296
339
  */
297
- deleteDatabase = (request) => this.client.fetch(
298
- {
299
- method: "DELETE",
300
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/databases/${validatePathParam("name", request.name)}`
301
- }
302
- );
340
+ deleteDatabase = (request) => this.client.fetch({
341
+ method: "DELETE",
342
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/databases/${validatePathParam("name", request.name)}`
343
+ });
303
344
  }
304
345
  export {
305
346
  API
@@ -4,7 +4,9 @@ const DEPLOYMENT_TRANSIENT_STATUSES = [
4
4
  "deleting",
5
5
  "locking",
6
6
  "unlocking",
7
- "deploying"
7
+ "deploying",
8
+ "stopping",
9
+ "starting"
8
10
  ];
9
11
  export {
10
12
  DEPLOYMENT_TRANSIENT_STATUSES
@@ -1,5 +1,5 @@
1
- export { API, } from './api.gen.js';
1
+ export { API } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
- export type { CreateDatabaseRequest, CreateDeploymentRequest, CreateEndpointRequest, CreateUserRequest, Database, DeleteDatabaseRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteUserRequest, Deployment, DeploymentStatus, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicDetails, EndpointService, EndpointServiceProtocol, EndpointSpec, EndpointSpecPrivateNetworkDetails, EndpointSpecPublicDetails, GetDeploymentCertificateRequest, GetDeploymentRequest, ListDatabasesRequest, ListDatabasesRequestOrderBy, ListDatabasesResponse, ListDeploymentsRequest, ListDeploymentsRequestOrderBy, ListDeploymentsResponse, ListPresetsRequest, ListPresetsResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, Preset, UpdateDeploymentRequest, UpdateUserRequest, User, Version, } from './types.gen.js';
4
+ export type { CreateDatabaseRequest, CreateDeploymentRequest, CreateEndpointRequest, CreateUserRequest, Database, DeleteDatabaseRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteUserRequest, Deployment, DeploymentStatus, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicDetails, EndpointService, EndpointServiceProtocol, EndpointSpec, EndpointSpecPrivateNetworkDetails, EndpointSpecPublicDetails, GetDeploymentCertificateRequest, GetDeploymentRequest, ListDatabasesRequest, ListDatabasesRequestOrderBy, ListDatabasesResponse, ListDeploymentsRequest, ListDeploymentsRequestOrderBy, ListDeploymentsResponse, ListPresetsRequest, ListPresetsResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, Preset, StartDeploymentRequest, StopDeploymentRequest, UpdateDeploymentRequest, UpdateUserRequest, User, Version, } from './types.gen.js';
5
5
  export * as ValidationRules from './validation-rules.gen.js';
@@ -184,7 +184,9 @@ const marshalEndpointSpec = (request, defaults) => ({
184
184
  },
185
185
  {
186
186
  param: "private_network",
187
- value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork) : void 0
187
+ value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(
188
+ request.privateNetwork
189
+ ) : void 0
188
190
  }
189
191
  ])
190
192
  });
@@ -1,5 +1,5 @@
1
1
  import type { Region as ScwRegion } from '@scaleway/sdk-client';
2
- export type DeploymentStatus = 'unknown_status' | 'ready' | 'creating' | 'configuring' | 'deleting' | 'error' | 'locked' | 'locking' | 'unlocking' | 'deploying';
2
+ export type DeploymentStatus = 'unknown_status' | 'ready' | 'creating' | 'configuring' | 'deleting' | 'error' | 'locked' | 'locking' | 'unlocking' | 'deploying' | 'stopping' | 'starting' | 'stopped';
3
3
  export type EndpointServiceProtocol = 'unknown_protocol' | 'tcp' | 'https' | 'mysql';
4
4
  export type ListDatabasesRequestOrderBy = 'name_asc' | 'name_desc' | 'size_asc' | 'size_desc';
5
5
  export type ListDeploymentsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'name_asc' | 'name_desc';
@@ -326,6 +326,9 @@ export type GetDeploymentCertificateRequest = {
326
326
  * Region to target. If none is passed will use default region from the config.
327
327
  */
328
328
  region?: ScwRegion;
329
+ /**
330
+ * UUID of the deployment.
331
+ */
329
332
  deploymentId: string;
330
333
  };
331
334
  export type GetDeploymentRequest = {
@@ -473,6 +476,26 @@ export interface ListVersionsResponse {
473
476
  */
474
477
  totalCount: number;
475
478
  }
479
+ export type StartDeploymentRequest = {
480
+ /**
481
+ * Region to target. If none is passed will use default region from the config.
482
+ */
483
+ region?: ScwRegion;
484
+ /**
485
+ * UUID of the deployment.
486
+ */
487
+ deploymentId: string;
488
+ };
489
+ export type StopDeploymentRequest = {
490
+ /**
491
+ * Region to target. If none is passed will use default region from the config.
492
+ */
493
+ region?: ScwRegion;
494
+ /**
495
+ * UUID of the deployment.
496
+ */
497
+ deploymentId: string;
498
+ };
476
499
  export type UpdateDeploymentRequest = {
477
500
  /**
478
501
  * Region to target. If none is passed will use default region from the config.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-datawarehouse",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK datawarehouse",
5
5
  "license": "Apache-2.0",
6
6
  "files": [