@scaleway/sdk-datalab 1.1.1 → 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 +1 -0
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1beta1/api.gen.js +115 -173
- package/dist/v1beta1/content.gen.js +5 -6
- package/dist/v1beta1/index.gen.js +16 -14
- package/dist/v1beta1/marshalling.gen.js +134 -196
- package/dist/v1beta1/validation-rules.gen.js +50 -62
- package/package.json +5 -5
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
package/dist/v1beta1/api.gen.js
CHANGED
|
@@ -1,175 +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,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
urlParams: urlParams(
|
|
118
|
-
["order_by", request.orderBy],
|
|
119
|
-
["page", request.page],
|
|
120
|
-
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
121
|
-
["resource_type", request.resourceType],
|
|
122
|
-
["targets", request.targets]
|
|
123
|
-
)
|
|
124
|
-
},
|
|
125
|
-
unmarshalListNodeTypesResponse
|
|
126
|
-
);
|
|
127
|
-
/**
|
|
128
|
-
* List the available compute node types for creating a Data Lab.
|
|
129
|
-
*
|
|
130
|
-
* @param request - The request {@link ListNodeTypesRequest}
|
|
131
|
-
* @returns A Promise of ListNodeTypesResponse
|
|
132
|
-
*/
|
|
133
|
-
listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
|
|
134
|
-
pageOfListNotebookVersions = (request = {}) => this.client.fetch(
|
|
135
|
-
{
|
|
136
|
-
method: "GET",
|
|
137
|
-
path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/notebook-versions`,
|
|
138
|
-
urlParams: urlParams(
|
|
139
|
-
["order_by", request.orderBy],
|
|
140
|
-
["page", request.page],
|
|
141
|
-
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
142
|
-
)
|
|
143
|
-
},
|
|
144
|
-
unmarshalListNotebookVersionsResponse
|
|
145
|
-
);
|
|
146
|
-
/**
|
|
147
|
-
* Lists available notebook versions.
|
|
148
|
-
*
|
|
149
|
-
* @param request - The request {@link ListNotebookVersionsRequest}
|
|
150
|
-
* @returns A Promise of ListNotebookVersionsResponse
|
|
151
|
-
*/
|
|
152
|
-
listNotebookVersions = (request = {}) => enrichForPagination("notebooks", this.pageOfListNotebookVersions, request);
|
|
153
|
-
pageOfListClusterVersions = (request = {}) => this.client.fetch(
|
|
154
|
-
{
|
|
155
|
-
method: "GET",
|
|
156
|
-
path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-versions`,
|
|
157
|
-
urlParams: urlParams(
|
|
158
|
-
["order_by", request.orderBy],
|
|
159
|
-
["page", request.page],
|
|
160
|
-
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
161
|
-
)
|
|
162
|
-
},
|
|
163
|
-
unmarshalListClusterVersionsResponse
|
|
164
|
-
);
|
|
165
|
-
/**
|
|
166
|
-
* List the Spark versions the product is compatible with.
|
|
167
|
-
*
|
|
168
|
-
* @param request - The request {@link ListClusterVersionsRequest}
|
|
169
|
-
* @returns A Promise of ListClusterVersionsResponse
|
|
170
|
-
*/
|
|
171
|
-
listClusterVersions = (request = {}) => enrichForPagination("clusters", this.pageOfListClusterVersions, request);
|
|
172
|
-
}
|
|
173
|
-
export {
|
|
174
|
-
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);
|
|
175
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
"creating",
|
|
4
|
+
"updating",
|
|
5
|
+
"deleting"
|
|
5
6
|
];
|
|
6
|
-
export {
|
|
7
|
-
DATALAB_TRANSIENT_STATUSES
|
|
8
|
-
};
|
|
7
|
+
export { DATALAB_TRANSIENT_STATUSES };
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
184
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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 };
|
|
@@ -1,69 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
lessThanOrEqual: 100
|
|
21
|
-
}
|
|
21
|
+
page: { greaterThanOrEqual: 1 },
|
|
22
|
+
pageSize: {
|
|
23
|
+
greaterThanOrEqual: 0,
|
|
24
|
+
lessThanOrEqual: 100
|
|
25
|
+
}
|
|
22
26
|
};
|
|
23
27
|
const ListDatalabsRequest = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
lessThanOrEqual: 100
|
|
44
|
-
}
|
|
40
|
+
page: { greaterThanOrEqual: 1 },
|
|
41
|
+
pageSize: {
|
|
42
|
+
greaterThanOrEqual: 0,
|
|
43
|
+
lessThanOrEqual: 100
|
|
44
|
+
}
|
|
45
45
|
};
|
|
46
46
|
const ListNotebookVersionsRequest = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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.
|
|
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.
|
|
30
|
-
"@scaleway/sdk-std": "2.
|
|
29
|
+
"@scaleway/random-name": "5.1.2",
|
|
30
|
+
"@scaleway/sdk-std": "2.2.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|