@scaleway/sdk-datawarehouse 2.2.0 → 2.3.1

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,7 +10,9 @@ class API extends API$1 {
10
10
  * type ∈ {'zone','region','global','unspecified'}
11
11
  */
12
12
  static LOCALITY = toApiLocality({
13
- regions: ["fr-par"]
13
+ regions: [
14
+ "fr-par"
15
+ ]
14
16
  });
15
17
  pageOfListPresets = (request = {}) => this.client.fetch(
16
18
  {
@@ -18,10 +20,7 @@ class API extends API$1 {
18
20
  path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/presets`,
19
21
  urlParams: urlParams(
20
22
  ["page", request.page],
21
- [
22
- "page_size",
23
- request.pageSize ?? this.client.settings.defaultPageSize
24
- ]
23
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
25
24
  )
26
25
  },
27
26
  unmarshalListPresetsResponse
@@ -39,10 +38,7 @@ class API extends API$1 {
39
38
  path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
40
39
  urlParams: urlParams(
41
40
  ["page", request.page],
42
- [
43
- "page_size",
44
- request.pageSize ?? this.client.settings.defaultPageSize
45
- ],
41
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
46
42
  ["version", request.version]
47
43
  )
48
44
  },
@@ -64,10 +60,7 @@ class API extends API$1 {
64
60
  ["order_by", request.orderBy],
65
61
  ["organization_id", request.organizationId],
66
62
  ["page", request.page],
67
- [
68
- "page_size",
69
- request.pageSize ?? this.client.settings.defaultPageSize
70
- ],
63
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
71
64
  ["project_id", request.projectId],
72
65
  ["tags", request.tags]
73
66
  )
@@ -102,9 +95,7 @@ class API extends API$1 {
102
95
  * @returns A Promise of Deployment
103
96
  */
104
97
  waitForDeployment = (request, options) => waitForResource(
105
- options?.stop ?? ((res) => Promise.resolve(
106
- !DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status)
107
- )),
98
+ options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))),
108
99
  this.getDeployment,
109
100
  request,
110
101
  options
@@ -156,12 +147,52 @@ class API extends API$1 {
156
147
  },
157
148
  unmarshalDeployment
158
149
  );
159
- getDeploymentCertificate = (request) => this.client.fetch({
160
- method: "GET",
161
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
162
- urlParams: urlParams(["dl", 1]),
163
- responseType: "blob"
164
- });
150
+ /**
151
+ * Get deployment TLS certificate. Retrieve the TLS certificate associated with a deployment.
152
+ *
153
+ * @param request - The request {@link GetDeploymentCertificateRequest}
154
+ * @returns A Promise of Blob
155
+ */
156
+ getDeploymentCertificate = (request) => this.client.fetch(
157
+ {
158
+ method: "GET",
159
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate`,
160
+ urlParams: urlParams(
161
+ ["dl", 1]
162
+ ),
163
+ responseType: "blob"
164
+ }
165
+ );
166
+ /**
167
+ * Start a deployment. Start a stopped deployment.
168
+ *
169
+ * @param request - The request {@link StartDeploymentRequest}
170
+ * @returns A Promise of Deployment
171
+ */
172
+ startDeployment = (request) => this.client.fetch(
173
+ {
174
+ body: "{}",
175
+ headers: jsonContentHeaders,
176
+ method: "POST",
177
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/start`
178
+ },
179
+ unmarshalDeployment
180
+ );
181
+ /**
182
+ * Stop a deployment. Stop a running deployment.
183
+ *
184
+ * @param request - The request {@link StopDeploymentRequest}
185
+ * @returns A Promise of Deployment
186
+ */
187
+ stopDeployment = (request) => this.client.fetch(
188
+ {
189
+ body: "{}",
190
+ headers: jsonContentHeaders,
191
+ method: "POST",
192
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/stop`
193
+ },
194
+ unmarshalDeployment
195
+ );
165
196
  pageOfListUsers = (request) => this.client.fetch(
166
197
  {
167
198
  method: "GET",
@@ -170,10 +201,7 @@ class API extends API$1 {
170
201
  ["name", request.name],
171
202
  ["order_by", request.orderBy],
172
203
  ["page", request.page],
173
- [
174
- "page_size",
175
- request.pageSize ?? this.client.settings.defaultPageSize
176
- ]
204
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
177
205
  )
178
206
  },
179
207
  unmarshalListUsersResponse
@@ -224,21 +252,25 @@ class API extends API$1 {
224
252
  *
225
253
  * @param request - The request {@link DeleteUserRequest}
226
254
  */
227
- deleteUser = (request) => this.client.fetch({
228
- body: "{}",
229
- headers: jsonContentHeaders,
230
- method: "DELETE",
231
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users/${validatePathParam("name", request.name)}`
232
- });
255
+ deleteUser = (request) => this.client.fetch(
256
+ {
257
+ body: "{}",
258
+ headers: jsonContentHeaders,
259
+ method: "DELETE",
260
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users/${validatePathParam("name", request.name)}`
261
+ }
262
+ );
233
263
  /**
234
264
  * Delete an endpoint from a deployment.
235
265
  *
236
266
  * @param request - The request {@link DeleteEndpointRequest}
237
267
  */
238
- deleteEndpoint = (request) => this.client.fetch({
239
- method: "DELETE",
240
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
241
- });
268
+ deleteEndpoint = (request) => this.client.fetch(
269
+ {
270
+ method: "DELETE",
271
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
272
+ }
273
+ );
242
274
  /**
243
275
  * Create a new endpoint for a deployment.
244
276
  *
@@ -264,10 +296,7 @@ class API extends API$1 {
264
296
  ["name", request.name],
265
297
  ["order_by", request.orderBy],
266
298
  ["page", request.page],
267
- [
268
- "page_size",
269
- request.pageSize ?? this.client.settings.defaultPageSize
270
- ]
299
+ ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
271
300
  )
272
301
  },
273
302
  unmarshalListDatabasesResponse
@@ -301,10 +330,12 @@ class API extends API$1 {
301
330
  *
302
331
  * @param request - The request {@link DeleteDatabaseRequest}
303
332
  */
304
- deleteDatabase = (request) => this.client.fetch({
305
- method: "DELETE",
306
- path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/databases/${validatePathParam("name", request.name)}`
307
- });
333
+ deleteDatabase = (request) => this.client.fetch(
334
+ {
335
+ method: "DELETE",
336
+ path: `/datawarehouse/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/databases/${validatePathParam("name", request.name)}`
337
+ }
338
+ );
308
339
  }
309
340
  export {
310
341
  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,9 +184,7 @@ const marshalEndpointSpec = (request, defaults) => ({
184
184
  },
185
185
  {
186
186
  param: "private_network",
187
- value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(
188
- request.privateNetwork
189
- ) : void 0
187
+ value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork) : void 0
190
188
  }
191
189
  ])
192
190
  });
@@ -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.2.0",
3
+ "version": "2.3.1",
4
4
  "description": "Scaleway SDK datawarehouse",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.1.1"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@scaleway/sdk-client": "^2.1.0"