@scaleway/sdk 2.21.1 → 2.23.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.
@@ -0,0 +1,233 @@
1
+ import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
+ import { API as API$1 } from '../../../scw/api.js';
3
+ import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
+ import { DEPLOYMENT_TRANSIENT_STATUSES } from './content.gen.js';
6
+ import { unmarshalListDeploymentsResponse, unmarshalDeployment, marshalCreateDeploymentRequest, marshalUpdateDeploymentRequest, marshalCreateEndpointRequest, unmarshalEndpoint, marshalUpdateEndpointRequest, unmarshalListDeploymentACLRulesResponse, marshalAddDeploymentACLRulesRequest, unmarshalAddDeploymentACLRulesResponse, marshalSetDeploymentACLRulesRequest, unmarshalSetDeploymentACLRulesResponse, unmarshalListModelsResponse, unmarshalModel, unmarshalEula, unmarshalListNodeTypesResponse } from './marshalling.gen.js';
7
+
8
+ // This file was automatically generated. DO NOT EDIT.
9
+ // If you have any remark or suggestion do not hesitate to open an issue.
10
+ const jsonContentHeaders = {
11
+ 'Content-Type': 'application/json; charset=utf-8'
12
+ };
13
+
14
+ /** LLM Inference API. */
15
+ class API extends API$1 {
16
+ /** Lists the available regions of the API. */
17
+ static LOCALITIES = ['fr-par'];
18
+ pageOfListDeployments = (request = {}) => this.client.fetch({
19
+ method: 'GET',
20
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments`,
21
+ 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])
22
+ }, unmarshalListDeploymentsResponse);
23
+
24
+ /**
25
+ * List inference deployments. List all your inference deployments.
26
+ *
27
+ * @param request - The request {@link ListDeploymentsRequest}
28
+ * @returns A Promise of ListDeploymentsResponse
29
+ */
30
+ listDeployments = (request = {}) => enrichForPagination('deployments', this.pageOfListDeployments, request);
31
+
32
+ /**
33
+ * Get a deployment. Get the deployment for the given ID.
34
+ *
35
+ * @param request - The request {@link GetDeploymentRequest}
36
+ * @returns A Promise of Deployment
37
+ */
38
+ getDeployment = request => this.client.fetch({
39
+ method: 'GET',
40
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}`
41
+ }, unmarshalDeployment);
42
+
43
+ /**
44
+ * Waits for {@link Deployment} to be in a final state.
45
+ *
46
+ * @param request - The request {@link GetDeploymentRequest}
47
+ * @param options - The waiting options
48
+ * @returns A Promise of Deployment
49
+ */
50
+ waitForDeployment = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))), this.getDeployment, request, options);
51
+
52
+ /**
53
+ * Create a deployment. Create a new inference deployment related to a
54
+ * specific model.
55
+ *
56
+ * @param request - The request {@link CreateDeploymentRequest}
57
+ * @returns A Promise of Deployment
58
+ */
59
+ createDeployment = request => this.client.fetch({
60
+ body: JSON.stringify(marshalCreateDeploymentRequest(request, this.client.settings)),
61
+ headers: jsonContentHeaders,
62
+ method: 'POST',
63
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments`
64
+ }, unmarshalDeployment);
65
+
66
+ /**
67
+ * Update a deployment. Update an existing inference deployment.
68
+ *
69
+ * @param request - The request {@link UpdateDeploymentRequest}
70
+ * @returns A Promise of Deployment
71
+ */
72
+ updateDeployment = request => this.client.fetch({
73
+ body: JSON.stringify(marshalUpdateDeploymentRequest(request, this.client.settings)),
74
+ headers: jsonContentHeaders,
75
+ method: 'PATCH',
76
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}`
77
+ }, unmarshalDeployment);
78
+
79
+ /**
80
+ * Delete a deployment. Delete an existing inference deployment.
81
+ *
82
+ * @param request - The request {@link DeleteDeploymentRequest}
83
+ * @returns A Promise of Deployment
84
+ */
85
+ deleteDeployment = request => this.client.fetch({
86
+ method: 'DELETE',
87
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}`
88
+ }, unmarshalDeployment);
89
+
90
+ /**
91
+ * Get the CA certificate. Get the CA certificate used for the deployment of
92
+ * private endpoints. The CA certificate will be returned as a PEM file.
93
+ *
94
+ * @param request - The request {@link GetDeploymentCertificateRequest}
95
+ * @returns A Promise of Blob
96
+ */
97
+ getDeploymentCertificate = request => this.client.fetch({
98
+ method: 'GET',
99
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/certificate`,
100
+ urlParams: urlParams(['dl', 1]),
101
+ responseType: 'blob'
102
+ });
103
+
104
+ /**
105
+ * Create an endpoint. Create a new Endpoint related to a specific deployment.
106
+ *
107
+ * @param request - The request {@link CreateEndpointRequest}
108
+ * @returns A Promise of Endpoint
109
+ */
110
+ createEndpoint = request => this.client.fetch({
111
+ body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
112
+ headers: jsonContentHeaders,
113
+ method: 'POST',
114
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints`
115
+ }, unmarshalEndpoint);
116
+
117
+ /**
118
+ * Update an endpoint. Update an existing Endpoint.
119
+ *
120
+ * @param request - The request {@link UpdateEndpointRequest}
121
+ * @returns A Promise of Endpoint
122
+ */
123
+ updateEndpoint = request => this.client.fetch({
124
+ body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),
125
+ headers: jsonContentHeaders,
126
+ method: 'PATCH',
127
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`
128
+ }, unmarshalEndpoint);
129
+
130
+ /**
131
+ * Delete an endpoint. Delete an existing Endpoint.
132
+ *
133
+ * @param request - The request {@link DeleteEndpointRequest}
134
+ */
135
+ deleteEndpoint = request => this.client.fetch({
136
+ method: 'DELETE',
137
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`
138
+ });
139
+ pageOfListDeploymentACLRules = request => this.client.fetch({
140
+ method: 'GET',
141
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/acls`,
142
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
143
+ }, unmarshalListDeploymentACLRulesResponse);
144
+
145
+ /**
146
+ * List your ACLs. List ACLs for a specific deployment.
147
+ *
148
+ * @param request - The request {@link ListDeploymentACLRulesRequest}
149
+ * @returns A Promise of ListDeploymentACLRulesResponse
150
+ */
151
+ listDeploymentACLRules = request => enrichForPagination('rules', this.pageOfListDeploymentACLRules, request);
152
+
153
+ /**
154
+ * Add new ACLs. Add new ACL rules for a specific deployment.
155
+ *
156
+ * @param request - The request {@link AddDeploymentACLRulesRequest}
157
+ * @returns A Promise of AddDeploymentACLRulesResponse
158
+ */
159
+ addDeploymentACLRules = request => this.client.fetch({
160
+ body: JSON.stringify(marshalAddDeploymentACLRulesRequest(request, this.client.settings)),
161
+ headers: jsonContentHeaders,
162
+ method: 'POST',
163
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/acls`
164
+ }, unmarshalAddDeploymentACLRulesResponse);
165
+
166
+ /**
167
+ * Set new ACL. Set new ACL rules for a specific deployment.
168
+ *
169
+ * @param request - The request {@link SetDeploymentACLRulesRequest}
170
+ * @returns A Promise of SetDeploymentACLRulesResponse
171
+ */
172
+ setDeploymentACLRules = request => this.client.fetch({
173
+ body: JSON.stringify(marshalSetDeploymentACLRulesRequest(request, this.client.settings)),
174
+ headers: jsonContentHeaders,
175
+ method: 'PUT',
176
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/acls`
177
+ }, unmarshalSetDeploymentACLRulesResponse);
178
+
179
+ /**
180
+ * Delete an exising ACL.
181
+ *
182
+ * @param request - The request {@link DeleteDeploymentACLRuleRequest}
183
+ */
184
+ deleteDeploymentACLRule = request => this.client.fetch({
185
+ method: 'DELETE',
186
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`
187
+ });
188
+ pageOfListModels = (request = {}) => this.client.fetch({
189
+ method: 'GET',
190
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/models`,
191
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])
192
+ }, unmarshalListModelsResponse);
193
+
194
+ /**
195
+ * List models. List all available LLM models.
196
+ *
197
+ * @param request - The request {@link ListModelsRequest}
198
+ * @returns A Promise of ListModelsResponse
199
+ */
200
+ listModels = (request = {}) => enrichForPagination('models', this.pageOfListModels, request);
201
+
202
+ /**
203
+ * Get a model. Get the model for the given ID.
204
+ *
205
+ * @param request - The request {@link GetModelRequest}
206
+ * @returns A Promise of Model
207
+ */
208
+ getModel = request => this.client.fetch({
209
+ method: 'GET',
210
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam('modelId', request.modelId)}`
211
+ }, unmarshalModel);
212
+ getModelEula = request => this.client.fetch({
213
+ method: 'GET',
214
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam('modelId', request.modelId)}/eula`
215
+ }, unmarshalEula);
216
+ pageOfListNodeTypes = request => this.client.fetch({
217
+ method: 'GET',
218
+ path: `/llm-inference/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/node-types`,
219
+ urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
220
+ }, unmarshalListNodeTypesResponse);
221
+
222
+ /**
223
+ * List available node types. List all available node types. By default, the
224
+ * node types returned in the list are ordered by creation date in ascending
225
+ * order, though this can be modified via the `order_by` field.
226
+ *
227
+ * @param request - The request {@link ListNodeTypesRequest}
228
+ * @returns A Promise of ListNodeTypesResponse
229
+ */
230
+ listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request);
231
+ }
232
+
233
+ export { API };
@@ -0,0 +1,7 @@
1
+ // This file was automatically generated. DO NOT EDIT.
2
+ // If you have any remark or suggestion do not hesitate to open an issue.
3
+
4
+ /** Lists transient statutes of the enum {@link DeploymentStatus}. */
5
+ const DEPLOYMENT_TRANSIENT_STATUSES = ['creating', 'deploying', 'deleting'];
6
+
7
+ export { DEPLOYMENT_TRANSIENT_STATUSES };
@@ -0,0 +1,7 @@
1
+ export { API } from './api.gen.js';
2
+ export { DEPLOYMENT_TRANSIENT_STATUSES } from './content.gen.js';
3
+ import * as validationRules_gen from './validation-rules.gen.js';
4
+ export { validationRules_gen as ValidationRules };
5
+
6
+ // This file was automatically generated. DO NOT EDIT.
7
+ // If you have any remark or suggestion do not hesitate to open an issue.
@@ -0,0 +1,225 @@
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.3/node_modules/@scaleway/random-name/dist/index.js';
2
+ import { isJSONObject } from '../../../helpers/json.js';
3
+ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
+
5
+ // This file was automatically generated. DO NOT EDIT.
6
+ // If you have any remark or suggestion do not hesitate to open an issue.
7
+ const unmarshalEndpointPrivateNetworkDetails = data => {
8
+ if (!isJSONObject(data)) {
9
+ throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
10
+ }
11
+ return {
12
+ privateNetworkId: data.private_network_id
13
+ };
14
+ };
15
+ const unmarshalEndpointPublicAccessDetails = data => {
16
+ if (!isJSONObject(data)) {
17
+ throw new TypeError(`Unmarshalling the type 'EndpointPublicAccessDetails' failed as data isn't a dictionary.`);
18
+ }
19
+ return {};
20
+ };
21
+ const unmarshalEndpoint = data => {
22
+ if (!isJSONObject(data)) {
23
+ throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
24
+ }
25
+ return {
26
+ disableAuth: data.disable_auth,
27
+ id: data.id,
28
+ privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined,
29
+ publicAccess: data.public_access ? unmarshalEndpointPublicAccessDetails(data.public_access) : undefined,
30
+ url: data.url
31
+ };
32
+ };
33
+ const unmarshalDeployment = data => {
34
+ if (!isJSONObject(data)) {
35
+ throw new TypeError(`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`);
36
+ }
37
+ return {
38
+ createdAt: unmarshalDate(data.created_at),
39
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
40
+ errorMessage: data.error_message,
41
+ id: data.id,
42
+ maxSize: data.max_size,
43
+ minSize: data.min_size,
44
+ modelName: data.model_name,
45
+ name: data.name,
46
+ nodeType: data.node_type,
47
+ projectId: data.project_id,
48
+ region: data.region,
49
+ size: data.size,
50
+ status: data.status,
51
+ tags: data.tags,
52
+ updatedAt: unmarshalDate(data.updated_at)
53
+ };
54
+ };
55
+ const unmarshalModelS3Model = data => {
56
+ if (!isJSONObject(data)) {
57
+ throw new TypeError(`Unmarshalling the type 'ModelS3Model' failed as data isn't a dictionary.`);
58
+ }
59
+ return {
60
+ nodeType: data.node_type,
61
+ pythonDependencies: data.python_dependencies,
62
+ s3Url: data.s3_url,
63
+ tritonServerVersion: data.triton_server_version
64
+ };
65
+ };
66
+ const unmarshalModel = data => {
67
+ if (!isJSONObject(data)) {
68
+ throw new TypeError(`Unmarshalling the type 'Model' failed as data isn't a dictionary.`);
69
+ }
70
+ return {
71
+ compatibleNodeTypes: data.compatible_node_types,
72
+ createdAt: unmarshalDate(data.created_at),
73
+ description: data.description,
74
+ hasEula: data.has_eula,
75
+ id: data.id,
76
+ isPublic: data.is_public,
77
+ name: data.name,
78
+ projectId: data.project_id,
79
+ provider: data.provider,
80
+ quantizationLevel: data.quantization_level,
81
+ region: data.region,
82
+ s3Model: data.s3_model ? unmarshalModelS3Model(data.s3_model) : undefined,
83
+ tags: data.tags,
84
+ updatedAt: unmarshalDate(data.updated_at)
85
+ };
86
+ };
87
+ const unmarshalACLRule = data => {
88
+ if (!isJSONObject(data)) {
89
+ throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
90
+ }
91
+ return {
92
+ description: data.description,
93
+ id: data.id,
94
+ ip: data.ip
95
+ };
96
+ };
97
+ const unmarshalAddDeploymentACLRulesResponse = data => {
98
+ if (!isJSONObject(data)) {
99
+ throw new TypeError(`Unmarshalling the type 'AddDeploymentACLRulesResponse' failed as data isn't a dictionary.`);
100
+ }
101
+ return {
102
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
103
+ };
104
+ };
105
+ const unmarshalEula = data => {
106
+ if (!isJSONObject(data)) {
107
+ throw new TypeError(`Unmarshalling the type 'Eula' failed as data isn't a dictionary.`);
108
+ }
109
+ return {
110
+ content: data.content
111
+ };
112
+ };
113
+ const unmarshalListDeploymentACLRulesResponse = data => {
114
+ if (!isJSONObject(data)) {
115
+ throw new TypeError(`Unmarshalling the type 'ListDeploymentACLRulesResponse' failed as data isn't a dictionary.`);
116
+ }
117
+ return {
118
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
119
+ totalCount: data.total_count
120
+ };
121
+ };
122
+ const unmarshalListDeploymentsResponse = data => {
123
+ if (!isJSONObject(data)) {
124
+ throw new TypeError(`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`);
125
+ }
126
+ return {
127
+ deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
128
+ totalCount: data.total_count
129
+ };
130
+ };
131
+ const unmarshalListModelsResponse = data => {
132
+ if (!isJSONObject(data)) {
133
+ throw new TypeError(`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`);
134
+ }
135
+ return {
136
+ models: unmarshalArrayOfObject(data.models, unmarshalModel),
137
+ totalCount: data.total_count
138
+ };
139
+ };
140
+ const unmarshalNodeType = data => {
141
+ if (!isJSONObject(data)) {
142
+ throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
143
+ }
144
+ return {
145
+ beta: data.beta,
146
+ createdAt: unmarshalDate(data.created_at),
147
+ description: data.description,
148
+ disabled: data.disabled,
149
+ gpus: data.gpus,
150
+ memory: data.memory,
151
+ name: data.name,
152
+ region: data.region,
153
+ stockStatus: data.stock_status,
154
+ updatedAt: unmarshalDate(data.updated_at),
155
+ vcpus: data.vcpus,
156
+ vram: data.vram
157
+ };
158
+ };
159
+ const unmarshalListNodeTypesResponse = data => {
160
+ if (!isJSONObject(data)) {
161
+ throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
162
+ }
163
+ return {
164
+ nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
165
+ totalCount: data.total_count
166
+ };
167
+ };
168
+ const unmarshalSetDeploymentACLRulesResponse = data => {
169
+ if (!isJSONObject(data)) {
170
+ throw new TypeError(`Unmarshalling the type 'SetDeploymentACLRulesResponse' failed as data isn't a dictionary.`);
171
+ }
172
+ return {
173
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
174
+ };
175
+ };
176
+ const marshalACLRuleRequest = (request, defaults) => ({
177
+ description: request.description,
178
+ ip: request.ip
179
+ });
180
+ const marshalAddDeploymentACLRulesRequest = (request, defaults) => ({
181
+ acls: request.acls !== undefined ? request.acls.map(elt => marshalACLRuleRequest(elt)) : undefined
182
+ });
183
+ const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
184
+ private_network_id: request.privateNetworkId
185
+ });
186
+ const marshalEndpointSpecPublic = (request, defaults) => ({});
187
+ const marshalEndpointSpec = (request, defaults) => ({
188
+ disable_auth: request.disableAuth,
189
+ ...resolveOneOf([{
190
+ param: 'public',
191
+ value: request.public !== undefined ? marshalEndpointSpecPublic(request.public) : undefined
192
+ }, {
193
+ param: 'private_network',
194
+ value: request.privateNetwork !== undefined ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
195
+ }])
196
+ });
197
+ const marshalCreateDeploymentRequest = (request, defaults) => ({
198
+ accept_eula: request.acceptEula,
199
+ endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt)),
200
+ max_size: request.maxSize,
201
+ min_size: request.minSize,
202
+ model_name: request.modelName,
203
+ name: request.name || randomName('llm'),
204
+ node_type: request.nodeType,
205
+ project_id: request.projectId ?? defaults.defaultProjectId,
206
+ tags: request.tags
207
+ });
208
+ const marshalCreateEndpointRequest = (request, defaults) => ({
209
+ deployment_id: request.deploymentId,
210
+ endpoint: marshalEndpointSpec(request.endpoint)
211
+ });
212
+ const marshalSetDeploymentACLRulesRequest = (request, defaults) => ({
213
+ acls: request.acls !== undefined ? request.acls.map(elt => marshalACLRuleRequest(elt)) : undefined
214
+ });
215
+ const marshalUpdateDeploymentRequest = (request, defaults) => ({
216
+ max_size: request.maxSize,
217
+ min_size: request.minSize,
218
+ name: request.name,
219
+ tags: request.tags
220
+ });
221
+ const marshalUpdateEndpointRequest = (request, defaults) => ({
222
+ disable_auth: request.disableAuth
223
+ });
224
+
225
+ export { marshalAddDeploymentACLRulesRequest, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalSetDeploymentACLRulesRequest, marshalUpdateDeploymentRequest, marshalUpdateEndpointRequest, unmarshalAddDeploymentACLRulesResponse, unmarshalDeployment, unmarshalEndpoint, unmarshalEula, unmarshalListDeploymentACLRulesResponse, unmarshalListDeploymentsResponse, unmarshalListModelsResponse, unmarshalListNodeTypesResponse, unmarshalModel, unmarshalSetDeploymentACLRulesResponse };
@@ -0,0 +1,55 @@
1
+ // This file was automatically generated. DO NOT EDIT.
2
+ // If you have any remark or suggestion do not hesitate to open an issue.
3
+
4
+ const CreateDeploymentRequest = {
5
+ maxSize: {
6
+ greaterThanOrEqual: 1,
7
+ lessThanOrEqual: 50
8
+ },
9
+ minSize: {
10
+ greaterThanOrEqual: 1,
11
+ lessThanOrEqual: 50
12
+ },
13
+ modelName: {
14
+ maxLength: 255,
15
+ minLength: 0,
16
+ pattern: /^[\w-_]+\/[\w-_.]+(:[\w]+)?$/
17
+ },
18
+ name: {
19
+ maxLength: 255,
20
+ minLength: 1,
21
+ pattern: /^[A-Za-z0-9-_]+$/
22
+ },
23
+ nodeType: {
24
+ maxLength: 64,
25
+ minLength: 1
26
+ }
27
+ };
28
+ const ListDeploymentsRequest = {
29
+ name: {
30
+ maxLength: 255,
31
+ minLength: 1
32
+ }
33
+ };
34
+ const ListModelsRequest = {
35
+ name: {
36
+ maxLength: 255,
37
+ minLength: 1
38
+ }
39
+ };
40
+ const UpdateDeploymentRequest = {
41
+ maxSize: {
42
+ greaterThanOrEqual: 1,
43
+ lessThanOrEqual: 50
44
+ },
45
+ minSize: {
46
+ greaterThanOrEqual: 1,
47
+ lessThanOrEqual: 50
48
+ },
49
+ name: {
50
+ maxLength: 255,
51
+ minLength: 1
52
+ }
53
+ };
54
+
55
+ export { CreateDeploymentRequest, ListDeploymentsRequest, ListModelsRequest, UpdateDeploymentRequest };
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { DATABASE_BACKUP_TRANSIENT_STATUSES, INSTANCE_TRANSIENT_STATUSES, READ_REPLICA_TRANSIENT_STATUSES, INSTANCE_LOG_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { unmarshalListDatabaseEnginesResponse, unmarshalListNodeTypesResponse, unmarshalListDatabaseBackupsResponse, marshalCreateDatabaseBackupRequest, unmarshalDatabaseBackup, marshalUpdateDatabaseBackupRequest, marshalRestoreDatabaseBackupRequest, marshalUpgradeInstanceRequest, unmarshalInstance, unmarshalListInstancesResponse, marshalCreateInstanceRequest, marshalUpdateInstanceRequest, marshalCloneInstanceRequest, unmarshalInstanceMetrics, marshalCreateReadReplicaRequest, unmarshalReadReplica, marshalCreateReadReplicaEndpointRequest, marshalPrepareInstanceLogsRequest, unmarshalPrepareInstanceLogsResponse, unmarshalListInstanceLogsResponse, unmarshalInstanceLog, marshalPurgeInstanceLogsRequest, unmarshalListInstanceLogsDetailsResponse, marshalAddInstanceSettingsRequest, unmarshalAddInstanceSettingsResponse, marshalDeleteInstanceSettingsRequest, unmarshalDeleteInstanceSettingsResponse, marshalSetInstanceSettingsRequest, unmarshalSetInstanceSettingsResponse, unmarshalListInstanceACLRulesResponse, marshalAddInstanceACLRulesRequest, unmarshalAddInstanceACLRulesResponse, marshalSetInstanceACLRulesRequest, unmarshalSetInstanceACLRulesResponse, marshalDeleteInstanceACLRulesRequest, unmarshalDeleteInstanceACLRulesResponse, unmarshalListUsersResponse, marshalCreateUserRequest, unmarshalUser, marshalUpdateUserRequest, unmarshalListDatabasesResponse, marshalCreateDatabaseRequest, unmarshalDatabase, unmarshalListPrivilegesResponse, marshalSetPrivilegeRequest, unmarshalPrivilege, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalUpdateSnapshotRequest, marshalCreateInstanceFromSnapshotRequest, marshalCreateEndpointRequest, unmarshalEndpoint, marshalMigrateEndpointRequest } from './marshalling.gen.js';
6
+ import { unmarshalListDatabaseEnginesResponse, unmarshalListNodeTypesResponse, unmarshalListDatabaseBackupsResponse, marshalCreateDatabaseBackupRequest, unmarshalDatabaseBackup, marshalUpdateDatabaseBackupRequest, marshalRestoreDatabaseBackupRequest, marshalUpgradeInstanceRequest, unmarshalInstance, unmarshalListInstancesResponse, marshalCreateInstanceRequest, marshalUpdateInstanceRequest, marshalCloneInstanceRequest, unmarshalInstanceMetrics, marshalCreateReadReplicaRequest, unmarshalReadReplica, marshalCreateReadReplicaEndpointRequest, marshalPrepareInstanceLogsRequest, unmarshalPrepareInstanceLogsResponse, unmarshalListInstanceLogsResponse, unmarshalInstanceLog, marshalPurgeInstanceLogsRequest, unmarshalListInstanceLogsDetailsResponse, marshalAddInstanceSettingsRequest, unmarshalAddInstanceSettingsResponse, marshalDeleteInstanceSettingsRequest, unmarshalDeleteInstanceSettingsResponse, marshalSetInstanceSettingsRequest, unmarshalSetInstanceSettingsResponse, unmarshalListInstanceACLRulesResponse, marshalAddInstanceACLRulesRequest, unmarshalAddInstanceACLRulesResponse, marshalSetInstanceACLRulesRequest, unmarshalSetInstanceACLRulesResponse, marshalDeleteInstanceACLRulesRequest, unmarshalDeleteInstanceACLRulesResponse, unmarshalListUsersResponse, marshalCreateUserRequest, unmarshalUser, marshalUpdateUserRequest, unmarshalListDatabasesResponse, marshalCreateDatabaseRequest, unmarshalDatabase, unmarshalListPrivilegesResponse, marshalSetPrivilegeRequest, unmarshalPrivilege, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalUpdateSnapshotRequest, marshalCreateInstanceFromSnapshotRequest, marshalCreateEndpointRequest, unmarshalEndpoint, marshalMigrateEndpointRequest, unmarshalMaintenance } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -903,6 +903,23 @@ class API extends API$1 {
903
903
  method: 'POST',
904
904
  path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}/migrate`
905
905
  }, unmarshalEndpoint);
906
+
907
+ /**
908
+ * Apply Database Instance maintenance. Apply maintenance tasks to your
909
+ * Database Instance. This will trigger pending maintenance tasks to start in
910
+ * your Database Instance and can generate service interruption. Maintenance
911
+ * tasks can be applied between `starts_at` and `stops_at` times, and are run
912
+ * directly by Scaleway at `forced_at` timestamp.
913
+ *
914
+ * @param request - The request {@link ApplyInstanceMaintenanceRequest}
915
+ * @returns A Promise of Maintenance
916
+ */
917
+ applyInstanceMaintenance = request => this.client.fetch({
918
+ body: '{}',
919
+ headers: jsonContentHeaders,
920
+ method: 'POST',
921
+ path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/apply-maintenance`
922
+ }, unmarshalMaintenance);
906
923
  }
907
924
 
908
925
  export { API };
@@ -11,7 +11,7 @@ const INSTANCE_LOG_TRANSIENT_STATUSES = ['creating'];
11
11
  const INSTANCE_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing', 'backuping', 'snapshotting', 'restarting'];
12
12
 
13
13
  /** Lists transient statutes of the enum {@link MaintenanceStatus}. */
14
- const MAINTENANCE_TRANSIENT_STATUSES = ['pending'];
14
+ const MAINTENANCE_TRANSIENT_STATUSES = ['ongoing'];
15
15
 
16
16
  /** Lists transient statutes of the enum {@link ReadReplicaStatus}. */
17
17
  const READ_REPLICA_TRANSIENT_STATUSES = ['provisioning', 'initializing', 'deleting', 'configuring', 'promoting'];
@@ -1,7 +1,7 @@
1
1
  import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.3/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
- import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
4
+ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
7
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -42,6 +42,19 @@ const unmarshalEndpoint = data => {
42
42
  privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined
43
43
  };
44
44
  };
45
+ const unmarshalMaintenance = data => {
46
+ if (!isJSONObject(data)) {
47
+ throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
48
+ }
49
+ return {
50
+ closedAt: unmarshalDate(data.closed_at),
51
+ forcedAt: unmarshalDate(data.forced_at),
52
+ reason: data.reason,
53
+ startsAt: unmarshalDate(data.starts_at),
54
+ status: data.status,
55
+ stopsAt: unmarshalDate(data.stops_at)
56
+ };
57
+ };
45
58
  const unmarshalReadReplica = data => {
46
59
  if (!isJSONObject(data)) {
47
60
  throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`);
@@ -130,18 +143,6 @@ const unmarshalLogsPolicy = data => {
130
143
  totalDiskRetention: data.total_disk_retention
131
144
  };
132
145
  };
133
- const unmarshalMaintenance = data => {
134
- if (!isJSONObject(data)) {
135
- throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
136
- }
137
- return {
138
- closedAt: unmarshalDate(data.closed_at),
139
- reason: data.reason,
140
- startsAt: unmarshalDate(data.starts_at),
141
- status: data.status,
142
- stopsAt: unmarshalDate(data.stops_at)
143
- };
144
- };
145
146
  const unmarshalUpgradableVersion = data => {
146
147
  if (!isJSONObject(data)) {
147
148
  throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
@@ -709,4 +710,4 @@ const marshalUpgradeInstanceRequest = (request, defaults) => ({
709
710
  }])
710
711
  });
711
712
 
712
- export { marshalAddInstanceACLRulesRequest, marshalAddInstanceSettingsRequest, marshalCloneInstanceRequest, marshalCreateDatabaseBackupRequest, marshalCreateDatabaseRequest, marshalCreateEndpointRequest, marshalCreateInstanceFromSnapshotRequest, marshalCreateInstanceRequest, marshalCreateReadReplicaEndpointRequest, marshalCreateReadReplicaRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalDeleteInstanceACLRulesRequest, marshalDeleteInstanceSettingsRequest, marshalMigrateEndpointRequest, marshalPrepareInstanceLogsRequest, marshalPurgeInstanceLogsRequest, marshalRestoreDatabaseBackupRequest, marshalSetInstanceACLRulesRequest, marshalSetInstanceSettingsRequest, marshalSetPrivilegeRequest, marshalUpdateDatabaseBackupRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalACLRule, unmarshalAddInstanceACLRulesResponse, unmarshalAddInstanceSettingsResponse, unmarshalBackupSchedule, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalDeleteInstanceACLRulesResponse, unmarshalDeleteInstanceSettingsResponse, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceLog, unmarshalInstanceMetrics, unmarshalListDatabaseBackupsResponse, unmarshalListDatabaseEnginesResponse, unmarshalListDatabasesResponse, unmarshalListInstanceACLRulesResponse, unmarshalListInstanceLogsDetailsResponse, unmarshalListInstanceLogsResponse, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListPrivilegesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalPrepareInstanceLogsResponse, unmarshalPrivilege, unmarshalReadReplica, unmarshalSetInstanceACLRulesResponse, unmarshalSetInstanceSettingsResponse, unmarshalSnapshot, unmarshalUser };
713
+ export { marshalAddInstanceACLRulesRequest, marshalAddInstanceSettingsRequest, marshalCloneInstanceRequest, marshalCreateDatabaseBackupRequest, marshalCreateDatabaseRequest, marshalCreateEndpointRequest, marshalCreateInstanceFromSnapshotRequest, marshalCreateInstanceRequest, marshalCreateReadReplicaEndpointRequest, marshalCreateReadReplicaRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalDeleteInstanceACLRulesRequest, marshalDeleteInstanceSettingsRequest, marshalMigrateEndpointRequest, marshalPrepareInstanceLogsRequest, marshalPurgeInstanceLogsRequest, marshalRestoreDatabaseBackupRequest, marshalSetInstanceACLRulesRequest, marshalSetInstanceSettingsRequest, marshalSetPrivilegeRequest, marshalUpdateDatabaseBackupRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalACLRule, unmarshalAddInstanceACLRulesResponse, unmarshalAddInstanceSettingsResponse, unmarshalBackupSchedule, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalDeleteInstanceACLRulesResponse, unmarshalDeleteInstanceSettingsResponse, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceLog, unmarshalInstanceMetrics, unmarshalListDatabaseBackupsResponse, unmarshalListDatabaseEnginesResponse, unmarshalListDatabasesResponse, unmarshalListInstanceACLRulesResponse, unmarshalListInstanceLogsDetailsResponse, unmarshalListInstanceLogsResponse, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListPrivilegesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalMaintenance, unmarshalPrepareInstanceLogsResponse, unmarshalPrivilege, unmarshalReadReplica, unmarshalSetInstanceACLRulesResponse, unmarshalSetInstanceSettingsResponse, unmarshalSnapshot, unmarshalUser };
@@ -20,7 +20,8 @@ class API extends API$1 {
20
20
  static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
21
21
 
22
22
  /**
23
- * Create a secret. You must specify the `region` to create a secret.
23
+ * Create a secret. Create a secret in a given region specified by the
24
+ * `region` parameter.
24
25
  *
25
26
  * @param request - The request {@link CreateSecretRequest}
26
27
  * @returns A Promise of Secret
@@ -96,7 +97,7 @@ class API extends API$1 {
96
97
  browseSecrets = request => this.client.fetch({
97
98
  method: 'GET',
98
99
  path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/browse`,
99
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['prefix', request.prefix], ['project_id', request.projectId])
100
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['prefix', request.prefix], ['project_id', request.projectId], ['tags', request.tags])
100
101
  }, unmarshalBrowseSecretsResponse);
101
102
 
102
103
  /**
@@ -68,7 +68,8 @@ const unmarshalAccessSecretVersionResponse = data => {
68
68
  data: data.data,
69
69
  dataCrc32: data.data_crc32,
70
70
  revision: data.revision,
71
- secretId: data.secret_id
71
+ secretId: data.secret_id,
72
+ type: data.type
72
73
  };
73
74
  };
74
75
  const unmarshalBrowseSecretsResponseItemFolderDetails = data => {