@scaleway/sdk-datalab 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Datalab.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v1beta1/index.gen.js";
2
- export {
3
- index_gen as Datalabv1beta1
4
- };
1
+ import { index_gen_exports } from "./v1beta1/index.gen.js";
2
+ export { index_gen_exports as Datalabv1beta1 };
@@ -61,7 +61,7 @@ export declare class API extends ParentAPI {
61
61
  deleteDatalab: (request: Readonly<DeleteDatalabRequest>) => Promise<Datalab>;
62
62
  protected pageOfListNodeTypes: (request?: Readonly<ListNodeTypesRequest>) => Promise<ListNodeTypesResponse>;
63
63
  /**
64
- * List the available compute node types upon which a Data Lab can be created.
64
+ * List the available compute node types for creating a Data Lab.
65
65
  *
66
66
  * @param request - The request {@link ListNodeTypesRequest}
67
67
  * @returns A Promise of ListNodeTypesResponse
@@ -72,7 +72,7 @@ export declare class API extends ParentAPI {
72
72
  };
73
73
  protected pageOfListNotebookVersions: (request?: Readonly<ListNotebookVersionsRequest>) => Promise<ListNotebookVersionsResponse>;
74
74
  /**
75
- * List available notebook versions.
75
+ * Lists available notebook versions.
76
76
  *
77
77
  * @param request - The request {@link ListNotebookVersionsRequest}
78
78
  * @returns A Promise of ListNotebookVersionsResponse
@@ -1,187 +1,117 @@
1
- import { API as API$1, toApiLocality, validatePathParam, waitForResource, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
1
  import { DATALAB_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { marshalCreateDatalabRequest, unmarshalDatalab, unmarshalListDatalabsResponse, marshalUpdateDatalabRequest, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse, unmarshalListClusterVersionsResponse } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
6
- };
7
- class API extends API$1 {
8
- /**
9
- * Locality of this API.
10
- * type ∈ {'zone','region','global','unspecified'}
11
- */
12
- static LOCALITY = toApiLocality({
13
- regions: ["fr-par"]
14
- });
15
- /**
16
- * Create a new Data Lab. In this call, one can personalize the node counts, add a notebook, choose the private network, define the persistent volume storage capacity.
17
- *
18
- * @param request - The request {@link CreateDatalabRequest}
19
- * @returns A Promise of Datalab
20
- */
21
- createDatalab = (request) => this.client.fetch(
22
- {
23
- body: JSON.stringify(
24
- marshalCreateDatalabRequest(request, this.client.settings)
25
- ),
26
- headers: jsonContentHeaders,
27
- method: "POST",
28
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`
29
- },
30
- unmarshalDatalab
31
- );
32
- /**
33
- * Retrieve information about a given Data Lab cluster, specified by the `region` and `datalab_id` parameters. Its full details, including name, status, node counts, are returned in the response object.
34
- *
35
- * @param request - The request {@link GetDatalabRequest}
36
- * @returns A Promise of Datalab
37
- */
38
- getDatalab = (request) => this.client.fetch(
39
- {
40
- method: "GET",
41
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
42
- },
43
- unmarshalDatalab
44
- );
45
- /**
46
- * Waits for {@link Datalab} to be in a final state.
47
- *
48
- * @param request - The request {@link GetDatalabRequest}
49
- * @param options - The waiting options
50
- * @returns A Promise of Datalab
51
- */
52
- waitForDatalab = (request, options) => waitForResource(
53
- options?.stop ?? ((res) => Promise.resolve(
54
- !DATALAB_TRANSIENT_STATUSES.includes(res.status)
55
- )),
56
- this.getDatalab,
57
- request,
58
- options
59
- );
60
- pageOfListDatalabs = (request = {}) => this.client.fetch(
61
- {
62
- method: "GET",
63
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`,
64
- urlParams: urlParams(
65
- ["name", request.name],
66
- ["order_by", request.orderBy],
67
- ["organization_id", request.organizationId],
68
- ["page", request.page],
69
- [
70
- "page_size",
71
- request.pageSize ?? this.client.settings.defaultPageSize
72
- ],
73
- ["project_id", request.projectId],
74
- ["tags", request.tags]
75
- )
76
- },
77
- unmarshalListDatalabsResponse
78
- );
79
- /**
80
- * List information about Data Lab cluster within a project or an organization.
81
- *
82
- * @param request - The request {@link ListDatalabsRequest}
83
- * @returns A Promise of ListDatalabsResponse
84
- */
85
- listDatalabs = (request = {}) => enrichForPagination("datalabs", this.pageOfListDatalabs, request);
86
- /**
87
- * Update a Data Labs node counts. Allows for up- and downscaling on demand, depending on the expected workload.
88
- *
89
- * @param request - The request {@link UpdateDatalabRequest}
90
- * @returns A Promise of Datalab
91
- */
92
- updateDatalab = (request) => this.client.fetch(
93
- {
94
- body: JSON.stringify(
95
- marshalUpdateDatalabRequest(request, this.client.settings)
96
- ),
97
- headers: jsonContentHeaders,
98
- method: "PATCH",
99
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
100
- },
101
- unmarshalDatalab
102
- );
103
- /**
104
- * Delete a Data Lab based on its region and id.
105
- *
106
- * @param request - The request {@link DeleteDatalabRequest}
107
- * @returns A Promise of Datalab
108
- */
109
- deleteDatalab = (request) => this.client.fetch(
110
- {
111
- method: "DELETE",
112
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
113
- },
114
- unmarshalDatalab
115
- );
116
- pageOfListNodeTypes = (request = {}) => this.client.fetch(
117
- {
118
- method: "GET",
119
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
120
- urlParams: urlParams(
121
- ["order_by", request.orderBy],
122
- ["page", request.page],
123
- [
124
- "page_size",
125
- request.pageSize ?? this.client.settings.defaultPageSize
126
- ],
127
- ["resource_type", request.resourceType],
128
- ["targets", request.targets]
129
- )
130
- },
131
- unmarshalListNodeTypesResponse
132
- );
133
- /**
134
- * List the available compute node types upon which a Data Lab can be created.
135
- *
136
- * @param request - The request {@link ListNodeTypesRequest}
137
- * @returns A Promise of ListNodeTypesResponse
138
- */
139
- listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
140
- pageOfListNotebookVersions = (request = {}) => this.client.fetch(
141
- {
142
- method: "GET",
143
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/notebook-versions`,
144
- urlParams: urlParams(
145
- ["order_by", request.orderBy],
146
- ["page", request.page],
147
- [
148
- "page_size",
149
- request.pageSize ?? this.client.settings.defaultPageSize
150
- ]
151
- )
152
- },
153
- unmarshalListNotebookVersionsResponse
154
- );
155
- /**
156
- * List available notebook versions.
157
- *
158
- * @param request - The request {@link ListNotebookVersionsRequest}
159
- * @returns A Promise of ListNotebookVersionsResponse
160
- */
161
- listNotebookVersions = (request = {}) => enrichForPagination("notebooks", this.pageOfListNotebookVersions, request);
162
- pageOfListClusterVersions = (request = {}) => this.client.fetch(
163
- {
164
- method: "GET",
165
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-versions`,
166
- urlParams: urlParams(
167
- ["order_by", request.orderBy],
168
- ["page", request.page],
169
- [
170
- "page_size",
171
- request.pageSize ?? this.client.settings.defaultPageSize
172
- ]
173
- )
174
- },
175
- unmarshalListClusterVersionsResponse
176
- );
177
- /**
178
- * List the Spark versions the product is compatible with.
179
- *
180
- * @param request - The request {@link ListClusterVersionsRequest}
181
- * @returns A Promise of ListClusterVersionsResponse
182
- */
183
- listClusterVersions = (request = {}) => enrichForPagination("clusters", this.pageOfListClusterVersions, request);
184
- }
185
- export {
186
- API
2
+ import { marshalCreateDatalabRequest, marshalUpdateDatalabRequest, unmarshalDatalab, unmarshalListClusterVersionsResponse, unmarshalListDatalabsResponse, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Data Lab API for Apache Spark™.
7
+
8
+ This API allows you to manage your Data Lab resources.
9
+ */
10
+ var API$1 = class extends API {
11
+ /**
12
+ * Locality of this API.
13
+ * type ∈ {'zone','region','global','unspecified'}
14
+ */
15
+ static LOCALITY = toApiLocality({ regions: ["fr-par"] });
16
+ /**
17
+ * Create a new Data Lab. In this call, one can personalize the node counts, add a notebook, choose the private network, define the persistent volume storage capacity.
18
+ *
19
+ * @param request - The request {@link CreateDatalabRequest}
20
+ * @returns A Promise of Datalab
21
+ */
22
+ createDatalab = (request) => this.client.fetch({
23
+ body: JSON.stringify(marshalCreateDatalabRequest(request, this.client.settings)),
24
+ headers: jsonContentHeaders,
25
+ method: "POST",
26
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`
27
+ }, unmarshalDatalab);
28
+ /**
29
+ * Retrieve information about a given Data Lab cluster, specified by the `region` and `datalab_id` parameters. Its full details, including name, status, node counts, are returned in the response object.
30
+ *
31
+ * @param request - The request {@link GetDatalabRequest}
32
+ * @returns A Promise of Datalab
33
+ */
34
+ getDatalab = (request) => this.client.fetch({
35
+ method: "GET",
36
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
37
+ }, unmarshalDatalab);
38
+ /**
39
+ * Waits for {@link Datalab} to be in a final state.
40
+ *
41
+ * @param request - The request {@link GetDatalabRequest}
42
+ * @param options - The waiting options
43
+ * @returns A Promise of Datalab
44
+ */
45
+ waitForDatalab = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DATALAB_TRANSIENT_STATUSES.includes(res.status))), this.getDatalab, request, options);
46
+ pageOfListDatalabs = (request = {}) => this.client.fetch({
47
+ method: "GET",
48
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`,
49
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
50
+ }, unmarshalListDatalabsResponse);
51
+ /**
52
+ * List information about Data Lab cluster within a project or an organization.
53
+ *
54
+ * @param request - The request {@link ListDatalabsRequest}
55
+ * @returns A Promise of ListDatalabsResponse
56
+ */
57
+ listDatalabs = (request = {}) => enrichForPagination("datalabs", this.pageOfListDatalabs, request);
58
+ /**
59
+ * Update a Data Labs node counts. Allows for up- and downscaling on demand, depending on the expected workload.
60
+ *
61
+ * @param request - The request {@link UpdateDatalabRequest}
62
+ * @returns A Promise of Datalab
63
+ */
64
+ updateDatalab = (request) => this.client.fetch({
65
+ body: JSON.stringify(marshalUpdateDatalabRequest(request, this.client.settings)),
66
+ headers: jsonContentHeaders,
67
+ method: "PATCH",
68
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
69
+ }, unmarshalDatalab);
70
+ /**
71
+ * Delete a Data Lab based on its region and id.
72
+ *
73
+ * @param request - The request {@link DeleteDatalabRequest}
74
+ * @returns A Promise of Datalab
75
+ */
76
+ deleteDatalab = (request) => this.client.fetch({
77
+ method: "DELETE",
78
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
79
+ }, unmarshalDatalab);
80
+ pageOfListNodeTypes = (request = {}) => this.client.fetch({
81
+ method: "GET",
82
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
83
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["resource_type", request.resourceType], ["targets", request.targets])
84
+ }, unmarshalListNodeTypesResponse);
85
+ /**
86
+ * List the available compute node types for creating a Data Lab.
87
+ *
88
+ * @param request - The request {@link ListNodeTypesRequest}
89
+ * @returns A Promise of ListNodeTypesResponse
90
+ */
91
+ listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
92
+ pageOfListNotebookVersions = (request = {}) => this.client.fetch({
93
+ method: "GET",
94
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/notebook-versions`,
95
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
96
+ }, unmarshalListNotebookVersionsResponse);
97
+ /**
98
+ * Lists available notebook versions.
99
+ *
100
+ * @param request - The request {@link ListNotebookVersionsRequest}
101
+ * @returns A Promise of ListNotebookVersionsResponse
102
+ */
103
+ listNotebookVersions = (request = {}) => enrichForPagination("notebooks", this.pageOfListNotebookVersions, request);
104
+ pageOfListClusterVersions = (request = {}) => this.client.fetch({
105
+ method: "GET",
106
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-versions`,
107
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
108
+ }, unmarshalListClusterVersionsResponse);
109
+ /**
110
+ * List the Spark versions the product is compatible with.
111
+ *
112
+ * @param request - The request {@link ListClusterVersionsRequest}
113
+ * @returns A Promise of ListClusterVersionsResponse
114
+ */
115
+ listClusterVersions = (request = {}) => enrichForPagination("clusters", this.pageOfListClusterVersions, request);
187
116
  };
117
+ export { API$1 as API };
@@ -1,8 +1,7 @@
1
+ /** Lists transient statutes of the enum {@link DatalabStatus}. */
1
2
  const DATALAB_TRANSIENT_STATUSES = [
2
- "creating",
3
- "updating",
4
- "deleting"
3
+ "creating",
4
+ "updating",
5
+ "deleting"
5
6
  ];
6
- export {
7
- DATALAB_TRANSIENT_STATUSES
8
- };
7
+ export { DATALAB_TRANSIENT_STATUSES };
@@ -1,4 +1,4 @@
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
4
  export type { Cluster, ClusterVersion, CreateDatalabRequest, CreateDatalabRequestSparkMain, CreateDatalabRequestSparkWorker, Datalab, DatalabSparkMain, DatalabSparkWorker, DatalabStatus, DeleteDatalabRequest, GetDatalabRequest, ListClusterVersionsRequest, ListClusterVersionsRequestOrderBy, ListClusterVersionsResponse, ListDatalabsRequest, ListDatalabsRequestOrderBy, ListDatalabsResponse, ListNodeTypesRequest, ListNodeTypesRequestOrderBy, ListNodeTypesRequestResourceType, ListNodeTypesResponse, ListNotebookVersionsRequest, ListNotebookVersionsRequestOrderBy, ListNotebookVersionsResponse, NodeType, NodeTypeStock, NodeTypeTarget, Notebook, NotebookVersion, UpdateDatalabRequest, Volume, VolumeType, } from './types.gen.js';
@@ -1,16 +1,18 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { DATALAB_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { marshalCreateDatalabRequest, marshalUpdateDatalabRequest, unmarshalDatalab, unmarshalListClusterVersionsResponse, unmarshalListDatalabsResponse, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse } from "./marshalling.gen.js";
4
- import * as validationRules_gen from "./validation-rules.gen.js";
5
- export {
6
- API,
7
- DATALAB_TRANSIENT_STATUSES,
8
- validationRules_gen as ValidationRules,
9
- marshalCreateDatalabRequest,
10
- marshalUpdateDatalabRequest,
11
- unmarshalDatalab,
12
- unmarshalListClusterVersionsResponse,
13
- unmarshalListDatalabsResponse,
14
- unmarshalListNodeTypesResponse,
15
- unmarshalListNotebookVersionsResponse
16
- };
4
+ import { API } from "./api.gen.js";
5
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
7
+ API: () => API,
8
+ DATALAB_TRANSIENT_STATUSES: () => DATALAB_TRANSIENT_STATUSES,
9
+ ValidationRules: () => validation_rules_gen_exports,
10
+ marshalCreateDatalabRequest: () => marshalCreateDatalabRequest,
11
+ marshalUpdateDatalabRequest: () => marshalUpdateDatalabRequest,
12
+ unmarshalDatalab: () => unmarshalDatalab,
13
+ unmarshalListClusterVersionsResponse: () => unmarshalListClusterVersionsResponse,
14
+ unmarshalListDatalabsResponse: () => unmarshalListDatalabsResponse,
15
+ unmarshalListNodeTypesResponse: () => unmarshalListNodeTypesResponse,
16
+ unmarshalListNotebookVersionsResponse: () => unmarshalListNotebookVersionsResponse
17
+ });
18
+ export { index_gen_exports };
@@ -1,220 +1,158 @@
1
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
- const unmarshalVolume = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- size: data.size,
10
- type: data.type
11
- };
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalVolume = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
4
+ return {
5
+ size: data.size,
6
+ type: data.type
7
+ };
12
8
  };
13
- const unmarshalDatalabSparkMain = (data) => {
14
- if (!isJSONObject(data)) {
15
- throw new TypeError(
16
- `Unmarshalling the type 'DatalabSparkMain' failed as data isn't a dictionary.`
17
- );
18
- }
19
- return {
20
- nodeType: data.node_type,
21
- rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0,
22
- sparkMasterUrl: data.spark_master_url,
23
- sparkUiUrl: data.spark_ui_url
24
- };
9
+ var unmarshalDatalabSparkMain = (data) => {
10
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatalabSparkMain' failed as data isn't a dictionary.`);
11
+ return {
12
+ nodeType: data.node_type,
13
+ rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0,
14
+ sparkMasterUrl: data.spark_master_url,
15
+ sparkUiUrl: data.spark_ui_url
16
+ };
25
17
  };
26
- const unmarshalDatalabSparkWorker = (data) => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(
29
- `Unmarshalling the type 'DatalabSparkWorker' failed as data isn't a dictionary.`
30
- );
31
- }
32
- return {
33
- nodeCount: data.node_count,
34
- nodeType: data.node_type,
35
- rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0
36
- };
18
+ var unmarshalDatalabSparkWorker = (data) => {
19
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatalabSparkWorker' failed as data isn't a dictionary.`);
20
+ return {
21
+ nodeCount: data.node_count,
22
+ nodeType: data.node_type,
23
+ rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0
24
+ };
37
25
  };
38
26
  const unmarshalDatalab = (data) => {
39
- if (!isJSONObject(data)) {
40
- throw new TypeError(
41
- `Unmarshalling the type 'Datalab' failed as data isn't a dictionary.`
42
- );
43
- }
44
- return {
45
- createdAt: unmarshalDate(data.created_at),
46
- description: data.description,
47
- hasNotebook: data.has_notebook,
48
- id: data.id,
49
- main: data.main ? unmarshalDatalabSparkMain(data.main) : void 0,
50
- name: data.name,
51
- notebookMasterUrl: data.notebook_master_url,
52
- notebookUrl: data.notebook_url,
53
- privateNetworkId: data.private_network_id,
54
- projectId: data.project_id,
55
- region: data.region,
56
- sparkVersion: data.spark_version,
57
- status: data.status,
58
- tags: data.tags,
59
- totalStorage: data.total_storage ? unmarshalVolume(data.total_storage) : void 0,
60
- updatedAt: unmarshalDate(data.updated_at),
61
- worker: data.worker ? unmarshalDatalabSparkWorker(data.worker) : void 0
62
- };
27
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Datalab' failed as data isn't a dictionary.`);
28
+ return {
29
+ createdAt: unmarshalDate(data.created_at),
30
+ description: data.description,
31
+ hasNotebook: data.has_notebook,
32
+ id: data.id,
33
+ main: data.main ? unmarshalDatalabSparkMain(data.main) : void 0,
34
+ name: data.name,
35
+ notebookMasterUrl: data.notebook_master_url,
36
+ notebookUrl: data.notebook_url,
37
+ privateNetworkId: data.private_network_id,
38
+ projectId: data.project_id,
39
+ region: data.region,
40
+ sparkVersion: data.spark_version,
41
+ status: data.status,
42
+ tags: data.tags,
43
+ totalStorage: data.total_storage ? unmarshalVolume(data.total_storage) : void 0,
44
+ updatedAt: unmarshalDate(data.updated_at),
45
+ worker: data.worker ? unmarshalDatalabSparkWorker(data.worker) : void 0
46
+ };
63
47
  };
64
- const unmarshalClusterVersion = (data) => {
65
- if (!isJSONObject(data)) {
66
- throw new TypeError(
67
- `Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`
68
- );
69
- }
70
- return {
71
- beta: data.beta,
72
- createdAt: unmarshalDate(data.created_at),
73
- disabled: data.disabled,
74
- endOfLife: unmarshalDate(data.end_of_life),
75
- updatedAt: unmarshalDate(data.updated_at),
76
- version: data.version
77
- };
48
+ var unmarshalClusterVersion = (data) => {
49
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`);
50
+ return {
51
+ beta: data.beta,
52
+ createdAt: unmarshalDate(data.created_at),
53
+ disabled: data.disabled,
54
+ endOfLife: unmarshalDate(data.end_of_life),
55
+ updatedAt: unmarshalDate(data.updated_at),
56
+ version: data.version
57
+ };
78
58
  };
79
- const unmarshalCluster = (data) => {
80
- if (!isJSONObject(data)) {
81
- throw new TypeError(
82
- `Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`
83
- );
84
- }
85
- return {
86
- description: data.description,
87
- name: data.name,
88
- versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
89
- };
59
+ var unmarshalCluster = (data) => {
60
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
61
+ return {
62
+ description: data.description,
63
+ name: data.name,
64
+ versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
65
+ };
90
66
  };
91
67
  const unmarshalListClusterVersionsResponse = (data) => {
92
- if (!isJSONObject(data)) {
93
- throw new TypeError(
94
- `Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`
95
- );
96
- }
97
- return {
98
- clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
99
- totalCount: data.total_count
100
- };
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`);
69
+ return {
70
+ clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
71
+ totalCount: data.total_count
72
+ };
101
73
  };
102
74
  const unmarshalListDatalabsResponse = (data) => {
103
- if (!isJSONObject(data)) {
104
- throw new TypeError(
105
- `Unmarshalling the type 'ListDatalabsResponse' failed as data isn't a dictionary.`
106
- );
107
- }
108
- return {
109
- datalabs: unmarshalArrayOfObject(data.datalabs, unmarshalDatalab),
110
- totalCount: data.total_count
111
- };
75
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatalabsResponse' failed as data isn't a dictionary.`);
76
+ return {
77
+ datalabs: unmarshalArrayOfObject(data.datalabs, unmarshalDatalab),
78
+ totalCount: data.total_count
79
+ };
112
80
  };
113
- const unmarshalNodeType = (data) => {
114
- if (!isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- beta: data.beta,
121
- createdAt: unmarshalDate(data.created_at),
122
- description: data.description,
123
- disabled: data.disabled,
124
- gpus: data.gpus,
125
- memoryGigabytes: data.memory_gigabytes,
126
- name: data.name,
127
- stockStatus: data.stock_status,
128
- targets: data.targets,
129
- updatedAt: unmarshalDate(data.updated_at),
130
- vcpus: data.vcpus,
131
- vramGigabytes: data.vram_gigabytes
132
- };
81
+ var unmarshalNodeType = (data) => {
82
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
83
+ return {
84
+ beta: data.beta,
85
+ createdAt: unmarshalDate(data.created_at),
86
+ description: data.description,
87
+ disabled: data.disabled,
88
+ gpus: data.gpus,
89
+ memoryGigabytes: data.memory_gigabytes,
90
+ name: data.name,
91
+ stockStatus: data.stock_status,
92
+ targets: data.targets,
93
+ updatedAt: unmarshalDate(data.updated_at),
94
+ vcpus: data.vcpus,
95
+ vramGigabytes: data.vram_gigabytes
96
+ };
133
97
  };
134
98
  const unmarshalListNodeTypesResponse = (data) => {
135
- if (!isJSONObject(data)) {
136
- throw new TypeError(
137
- `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
138
- );
139
- }
140
- return {
141
- nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
142
- totalCount: data.total_count
143
- };
99
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
100
+ return {
101
+ nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
102
+ totalCount: data.total_count
103
+ };
144
104
  };
145
- const unmarshalNotebookVersion = (data) => {
146
- if (!isJSONObject(data)) {
147
- throw new TypeError(
148
- `Unmarshalling the type 'NotebookVersion' failed as data isn't a dictionary.`
149
- );
150
- }
151
- return {
152
- beta: data.beta,
153
- createdAt: unmarshalDate(data.created_at),
154
- disabled: data.disabled,
155
- endOfLife: unmarshalDate(data.end_of_life),
156
- updatedAt: unmarshalDate(data.updated_at),
157
- version: data.version
158
- };
105
+ var unmarshalNotebookVersion = (data) => {
106
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NotebookVersion' failed as data isn't a dictionary.`);
107
+ return {
108
+ beta: data.beta,
109
+ createdAt: unmarshalDate(data.created_at),
110
+ disabled: data.disabled,
111
+ endOfLife: unmarshalDate(data.end_of_life),
112
+ updatedAt: unmarshalDate(data.updated_at),
113
+ version: data.version
114
+ };
159
115
  };
160
- const unmarshalNotebook = (data) => {
161
- if (!isJSONObject(data)) {
162
- throw new TypeError(
163
- `Unmarshalling the type 'Notebook' failed as data isn't a dictionary.`
164
- );
165
- }
166
- return {
167
- description: data.description,
168
- name: data.name,
169
- versions: unmarshalArrayOfObject(data.versions, unmarshalNotebookVersion)
170
- };
116
+ var unmarshalNotebook = (data) => {
117
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Notebook' failed as data isn't a dictionary.`);
118
+ return {
119
+ description: data.description,
120
+ name: data.name,
121
+ versions: unmarshalArrayOfObject(data.versions, unmarshalNotebookVersion)
122
+ };
171
123
  };
172
124
  const unmarshalListNotebookVersionsResponse = (data) => {
173
- if (!isJSONObject(data)) {
174
- throw new TypeError(
175
- `Unmarshalling the type 'ListNotebookVersionsResponse' failed as data isn't a dictionary.`
176
- );
177
- }
178
- return {
179
- notebooks: unmarshalArrayOfObject(data.notebooks, unmarshalNotebook),
180
- totalCount: data.total_count
181
- };
125
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNotebookVersionsResponse' failed as data isn't a dictionary.`);
126
+ return {
127
+ notebooks: unmarshalArrayOfObject(data.notebooks, unmarshalNotebook),
128
+ totalCount: data.total_count
129
+ };
182
130
  };
183
- const marshalCreateDatalabRequestSparkMain = (request, defaults) => ({
184
- node_type: request.nodeType
131
+ var marshalCreateDatalabRequestSparkMain = (request, defaults) => ({ node_type: request.nodeType });
132
+ var marshalCreateDatalabRequestSparkWorker = (request, defaults) => ({
133
+ node_count: request.nodeCount,
134
+ node_type: request.nodeType
185
135
  });
186
- const marshalCreateDatalabRequestSparkWorker = (request, defaults) => ({
187
- node_count: request.nodeCount,
188
- node_type: request.nodeType
189
- });
190
- const marshalVolume = (request, defaults) => ({
191
- size: request.size,
192
- type: request.type
136
+ var marshalVolume = (request, defaults) => ({
137
+ size: request.size,
138
+ type: request.type
193
139
  });
194
140
  const marshalCreateDatalabRequest = (request, defaults) => ({
195
- description: request.description,
196
- has_notebook: request.hasNotebook,
197
- main: request.main !== void 0 ? marshalCreateDatalabRequestSparkMain(request.main) : void 0,
198
- name: request.name,
199
- private_network_id: request.privateNetworkId,
200
- project_id: request.projectId ?? defaults.defaultProjectId,
201
- spark_version: request.sparkVersion,
202
- tags: request.tags,
203
- total_storage: request.totalStorage !== void 0 ? marshalVolume(request.totalStorage) : void 0,
204
- worker: request.worker !== void 0 ? marshalCreateDatalabRequestSparkWorker(request.worker) : void 0
141
+ description: request.description,
142
+ has_notebook: request.hasNotebook,
143
+ main: request.main !== void 0 ? marshalCreateDatalabRequestSparkMain(request.main, defaults) : void 0,
144
+ name: request.name,
145
+ private_network_id: request.privateNetworkId,
146
+ project_id: request.projectId ?? defaults.defaultProjectId,
147
+ spark_version: request.sparkVersion,
148
+ tags: request.tags,
149
+ total_storage: request.totalStorage !== void 0 ? marshalVolume(request.totalStorage, defaults) : void 0,
150
+ worker: request.worker !== void 0 ? marshalCreateDatalabRequestSparkWorker(request.worker, defaults) : void 0
205
151
  });
206
152
  const marshalUpdateDatalabRequest = (request, defaults) => ({
207
- description: request.description,
208
- name: request.name,
209
- node_count: request.nodeCount,
210
- tags: request.tags
153
+ description: request.description,
154
+ name: request.name,
155
+ node_count: request.nodeCount,
156
+ tags: request.tags
211
157
  });
212
- export {
213
- marshalCreateDatalabRequest,
214
- marshalUpdateDatalabRequest,
215
- unmarshalDatalab,
216
- unmarshalListClusterVersionsResponse,
217
- unmarshalListDatalabsResponse,
218
- unmarshalListNodeTypesResponse,
219
- unmarshalListNotebookVersionsResponse
220
- };
158
+ export { marshalCreateDatalabRequest, marshalUpdateDatalabRequest, unmarshalDatalab, unmarshalListClusterVersionsResponse, unmarshalListDatalabsResponse, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse };
@@ -114,7 +114,7 @@ export interface Datalab {
114
114
  */
115
115
  id: string;
116
116
  /**
117
- * The identifier of the project where the Data Lab has been created.
117
+ * The unique identifier of the project where the Data Lab has been created.
118
118
  */
119
119
  projectId: string;
120
120
  /**
@@ -130,15 +130,15 @@ export interface Datalab {
130
130
  */
131
131
  tags: string[];
132
132
  /**
133
- * The Spark Main node specification of Data lab. It holds the parameters `node_type` the compute node type of the main node, `spark_ui_url` where the Spark UI is available, `spark_master_url` with which one can connect to the cluster from within one's VPC, `root_volume` the size of the volume assigned to the main node.
133
+ * The Spark Main node specification of Data lab. It holds the parameters `node_type`, `spark_ui_url` (available to reach Spark UI), `spark_master_url` (used to reach the cluster within a VPC), `root_volume` (size of the volume assigned to the cluster).
134
134
  */
135
135
  main?: DatalabSparkMain;
136
136
  /**
137
- * The worker node specification of the Data Lab. It presents the parameters `node_type` the compute node type of each worker node, `node_count` the number of worker nodes currently in the cluster, `root_volume` the root volume size of each executor.
137
+ * The cluster worker nodes specification. It holds the parameters `node_type`, `node_count`, `root_volume` (size of the volume assigned to the cluster).
138
138
  */
139
139
  worker?: DatalabSparkWorker;
140
140
  /**
141
- * The status of the Data Lab. For a working Data Lab this should be `ready`.
141
+ * The status of the Data Lab. For a working Data Lab the status is marked as `ready`.
142
142
  */
143
143
  status: DatalabStatus;
144
144
  /**
@@ -158,7 +158,7 @@ export interface Datalab {
158
158
  */
159
159
  hasNotebook: boolean;
160
160
  /**
161
- * The URL of said notebook if exists.
161
+ * The URL of the notebook if available.
162
162
  */
163
163
  notebookUrl?: string;
164
164
  /**
@@ -166,15 +166,15 @@ export interface Datalab {
166
166
  */
167
167
  sparkVersion: string;
168
168
  /**
169
- * The total storage selected by the user for Spark.
169
+ * The total persistent volume storage selected to run Spark.
170
170
  */
171
171
  totalStorage?: Volume;
172
172
  /**
173
- * The private newtwork to which the data lab is connected. This is important for accessing the Spark Master URL.
173
+ * The unique identifier of the private network to which the Data Lab is attached to.
174
174
  */
175
175
  privateNetworkId: string;
176
176
  /**
177
- * The URL to the Spark Master endpoint from, and only from the perspective of the JupyterLab Notebook. This is NOT the URL to use for accessing the clutser from a private server.
177
+ * The URL that is used to reach the cluster from the notebook when available. This URL cannot be used to reach the cluster from a server.
178
178
  */
179
179
  notebookMasterUrl?: string;
180
180
  }
@@ -273,15 +273,15 @@ export type CreateDatalabRequest = {
273
273
  */
274
274
  tags?: string[];
275
275
  /**
276
- * The Spark main node configuration of the Data Lab, has one parameter `node_type` which specifies the compute node type of the main node. See ListNodeTypes for available options.
276
+ * The cluster main node specification. It holds the parameters `node_type` which specifies the node type of the main node. See ListNodeTypes for available options. See ListNodeTypes for available options.
277
277
  */
278
278
  main?: CreateDatalabRequestSparkMain;
279
279
  /**
280
- * The Spark worker node configuration of the Data Lab, has two parameters `node_type` for selecting the type of the worker node, and `node_count` for specifying the ammount of nodes.
280
+ * The cluster worker node specification. It holds the parameters `node_type` which specifies the node type of the worker node and `node_count` for specifying the amount of nodes.
281
281
  */
282
282
  worker?: CreateDatalabRequestSparkWorker;
283
283
  /**
284
- * Whether a JupyterLab notebook shall be created with the Data Lab or not.
284
+ * Select this option to include a notebook as part of the Data Lab.
285
285
  */
286
286
  hasNotebook: boolean;
287
287
  /**
@@ -289,11 +289,11 @@ export type CreateDatalabRequest = {
289
289
  */
290
290
  sparkVersion: string;
291
291
  /**
292
- * The total storage selected by the user for Spark workers. This means the workers will not use more then this amount for their workload.
292
+ * The maximum persistent volume storage that will be available during workload.
293
293
  */
294
294
  totalStorage?: Volume;
295
295
  /**
296
- * The private newtwork to which the Data Lab is connected. Important for accessing the Spark Master URL from a private cluster.
296
+ * The unique identifier of the private network the Data Lab will be attached to.
297
297
  */
298
298
  privateNetworkId: string;
299
299
  };
@@ -358,7 +358,7 @@ export interface ListClusterVersionsResponse {
358
358
  totalCount: number;
359
359
  }
360
360
  /**
361
- * A request to list Datalabs.
361
+ * A request to list Data Labs.
362
362
  */
363
363
  export type ListDatalabsRequest = {
364
364
  /**
@@ -403,7 +403,7 @@ export interface ListDatalabsResponse {
403
403
  */
404
404
  datalabs: Datalab[];
405
405
  /**
406
- * The total count of Datalabs.
406
+ * The total count of Data Labs.
407
407
  */
408
408
  totalCount: number;
409
409
  }
@@ -428,7 +428,7 @@ export type ListNodeTypesRequest = {
428
428
  */
429
429
  orderBy?: ListNodeTypesRequestOrderBy;
430
430
  /**
431
- * Filter on the wanted targets, whether it's for main node or worker.
431
+ * Filter based on the target of the nodes. Allows to filter the nodes based on their purpose which can be main or worker node.
432
432
  */
433
433
  targets?: NodeTypeTarget[];
434
434
  /**
@@ -1,69 +1,57 @@
1
- const CreateDatalabRequest = {
2
- name: {
3
- maxLength: 100,
4
- minLength: 3,
5
- pattern: /^[A-Za-z0-9-_. ]+$/
6
- }
7
- };
8
- const CreateDatalabRequestSparkWorker = {
9
- nodeCount: {
10
- greaterThanOrEqual: 1,
11
- lessThanOrEqual: 150
12
- }
13
- };
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
+ CreateDatalabRequest: () => CreateDatalabRequest,
4
+ CreateDatalabRequestSparkWorker: () => CreateDatalabRequestSparkWorker,
5
+ ListClusterVersionsRequest: () => ListClusterVersionsRequest,
6
+ ListDatalabsRequest: () => ListDatalabsRequest,
7
+ ListNodeTypesRequest: () => ListNodeTypesRequest,
8
+ ListNotebookVersionsRequest: () => ListNotebookVersionsRequest,
9
+ UpdateDatalabRequest: () => UpdateDatalabRequest
10
+ });
11
+ const CreateDatalabRequest = { name: {
12
+ maxLength: 100,
13
+ minLength: 3,
14
+ pattern: /^[A-Za-z0-9-_. ]+$/
15
+ } };
16
+ const CreateDatalabRequestSparkWorker = { nodeCount: {
17
+ greaterThanOrEqual: 1,
18
+ lessThanOrEqual: 150
19
+ } };
14
20
  const ListClusterVersionsRequest = {
15
- page: {
16
- greaterThanOrEqual: 1
17
- },
18
- pageSize: {
19
- greaterThanOrEqual: 0,
20
- lessThanOrEqual: 100
21
- }
21
+ page: { greaterThanOrEqual: 1 },
22
+ pageSize: {
23
+ greaterThanOrEqual: 0,
24
+ lessThanOrEqual: 100
25
+ }
22
26
  };
23
27
  const ListDatalabsRequest = {
24
- name: {
25
- maxLength: 100,
26
- minLength: 3,
27
- pattern: /^[A-Za-z0-9-_. ]+$/
28
- },
29
- page: {
30
- greaterThanOrEqual: 1
31
- },
32
- pageSize: {
33
- greaterThanOrEqual: 1,
34
- lessThanOrEqual: 100
35
- }
28
+ name: {
29
+ maxLength: 100,
30
+ minLength: 3,
31
+ pattern: /^[A-Za-z0-9-_. ]+$/
32
+ },
33
+ page: { greaterThanOrEqual: 1 },
34
+ pageSize: {
35
+ greaterThanOrEqual: 1,
36
+ lessThanOrEqual: 100
37
+ }
36
38
  };
37
39
  const ListNodeTypesRequest = {
38
- page: {
39
- greaterThanOrEqual: 1
40
- },
41
- pageSize: {
42
- greaterThanOrEqual: 0,
43
- lessThanOrEqual: 100
44
- }
40
+ page: { greaterThanOrEqual: 1 },
41
+ pageSize: {
42
+ greaterThanOrEqual: 0,
43
+ lessThanOrEqual: 100
44
+ }
45
45
  };
46
46
  const ListNotebookVersionsRequest = {
47
- page: {
48
- greaterThanOrEqual: 1
49
- },
50
- pageSize: {
51
- greaterThanOrEqual: 1,
52
- lessThanOrEqual: 100
53
- }
54
- };
55
- const UpdateDatalabRequest = {
56
- nodeCount: {
57
- greaterThanOrEqual: 0,
58
- lessThanOrEqual: 150
59
- }
60
- };
61
- export {
62
- CreateDatalabRequest,
63
- CreateDatalabRequestSparkWorker,
64
- ListClusterVersionsRequest,
65
- ListDatalabsRequest,
66
- ListNodeTypesRequest,
67
- ListNotebookVersionsRequest,
68
- UpdateDatalabRequest
69
- };
47
+ page: { greaterThanOrEqual: 1 },
48
+ pageSize: {
49
+ greaterThanOrEqual: 1,
50
+ lessThanOrEqual: 100
51
+ }
52
+ };
53
+ const UpdateDatalabRequest = { nodeCount: {
54
+ greaterThanOrEqual: 0,
55
+ lessThanOrEqual: 150
56
+ } };
57
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-datalab",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Scaleway SDK datalab",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "node": ">=20.18.3"
27
27
  },
28
28
  "dependencies": {
29
- "@scaleway/random-name": "5.1.1",
30
- "@scaleway/sdk-std": "2.1.0"
29
+ "@scaleway/random-name": "5.1.2",
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",