@scaleway/sdk 2.7.0 → 2.9.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/dist/api/block/v1alpha1/api.gen.js +1 -7
- package/dist/api/block/v1alpha1/marshalling.gen.js +1 -9
- package/dist/api/block/v1alpha1/validation-rules.gen.js +1 -6
- package/dist/api/instance/v1/marshalling.gen.js +3 -0
- package/dist/api/ipam/v1/marshalling.gen.js +15 -0
- package/dist/api/jobs/v1alpha1/api.gen.js +64 -0
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +20 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +31 -1
- package/dist/api/k8s/v1/marshalling.gen.js +11 -0
- package/dist/api/lb/v1/api.gen.js +2 -2
- package/dist/api/lb/v1/marshalling.gen.js +8 -0
- package/dist/api/secret/v1alpha1/api.gen.js +3 -3
- package/dist/api/secret/v1alpha1/marshalling.gen.js +37 -6
- package/dist/index.cjs +197 -32
- package/dist/index.d.ts +234 -39
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -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 { VOLUME_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from './content.gen.js';
|
|
6
|
-
import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest,
|
|
6
|
+
import { unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, marshalCreateVolumeRequest, unmarshalVolume, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalSnapshot, marshalCreateSnapshotRequest, marshalUpdateSnapshotRequest } 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.
|
|
@@ -166,12 +166,6 @@ class API extends API$1 {
|
|
|
166
166
|
method: 'POST',
|
|
167
167
|
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`
|
|
168
168
|
}, unmarshalSnapshot);
|
|
169
|
-
importSnapshotFromS3 = request => this.client.fetch({
|
|
170
|
-
body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),
|
|
171
|
-
headers: jsonContentHeaders,
|
|
172
|
-
method: 'POST',
|
|
173
|
-
path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`
|
|
174
|
-
}, unmarshalSnapshot);
|
|
175
169
|
|
|
176
170
|
/**
|
|
177
171
|
* Delete a snapshot. You must specify the `snapshot_id` of the snapshot you
|
|
@@ -162,14 +162,6 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
|
|
|
162
162
|
value: request.perfIops
|
|
163
163
|
}])
|
|
164
164
|
});
|
|
165
|
-
const marshalImportSnapshotFromS3Request = (request, defaults) => ({
|
|
166
|
-
bucket: request.bucket,
|
|
167
|
-
key: request.key,
|
|
168
|
-
name: request.name,
|
|
169
|
-
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
170
|
-
size: request.size,
|
|
171
|
-
tags: request.tags
|
|
172
|
-
});
|
|
173
165
|
const marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
174
166
|
name: request.name,
|
|
175
167
|
tags: request.tags
|
|
@@ -181,4 +173,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
|
|
|
181
173
|
tags: request.tags
|
|
182
174
|
});
|
|
183
175
|
|
|
184
|
-
export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest,
|
|
176
|
+
export { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalUpdateSnapshotRequest, marshalUpdateVolumeRequest, unmarshalListSnapshotsResponse, unmarshalListVolumeTypesResponse, unmarshalListVolumesResponse, unmarshalReference, unmarshalSnapshot, unmarshalVolume };
|
|
@@ -11,11 +11,6 @@ const CreateVolumeRequest = {
|
|
|
11
11
|
minLength: 1
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
const ImportSnapshotFromS3Request = {
|
|
15
|
-
name: {
|
|
16
|
-
minLength: 1
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
14
|
const ListSnapshotsRequest = {
|
|
20
15
|
page: {
|
|
21
16
|
greaterThan: 0
|
|
@@ -49,4 +44,4 @@ const Reference = {
|
|
|
49
44
|
}
|
|
50
45
|
};
|
|
51
46
|
|
|
52
|
-
export { CreateSnapshotRequest, CreateVolumeRequest,
|
|
47
|
+
export { CreateSnapshotRequest, CreateVolumeRequest, ListSnapshotsRequest, ListVolumeTypesRequest, ListVolumesRequest, Reference };
|
|
@@ -133,6 +133,7 @@ const unmarshalServerIp = data => {
|
|
|
133
133
|
family: data.family,
|
|
134
134
|
gateway: data.gateway,
|
|
135
135
|
id: data.id,
|
|
136
|
+
ipamId: data.ipam_id,
|
|
136
137
|
netmask: data.netmask,
|
|
137
138
|
provisioningMode: data.provisioning_mode,
|
|
138
139
|
state: data.state,
|
|
@@ -251,6 +252,7 @@ const unmarshalIp = data => {
|
|
|
251
252
|
return {
|
|
252
253
|
address: data.address,
|
|
253
254
|
id: data.id,
|
|
255
|
+
ipamId: data.ipam_id,
|
|
254
256
|
organization: data.organization,
|
|
255
257
|
prefix: data.prefix,
|
|
256
258
|
project: data.project,
|
|
@@ -1326,6 +1328,7 @@ const marshalServerIp = (request, defaults) => ({
|
|
|
1326
1328
|
family: request.family,
|
|
1327
1329
|
gateway: request.gateway,
|
|
1328
1330
|
id: request.id,
|
|
1331
|
+
ipam_id: request.ipamId,
|
|
1329
1332
|
netmask: request.netmask,
|
|
1330
1333
|
provisioning_mode: request.provisioningMode,
|
|
1331
1334
|
state: request.state,
|
|
@@ -14,6 +14,15 @@ const unmarshalResource = data => {
|
|
|
14
14
|
type: data.type
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
+
const unmarshalReverse = data => {
|
|
18
|
+
if (!isJSONObject(data)) {
|
|
19
|
+
throw new TypeError(`Unmarshalling the type 'Reverse' failed as data isn't a dictionary.`);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
address: data.address,
|
|
23
|
+
hostname: data.hostname
|
|
24
|
+
};
|
|
25
|
+
};
|
|
17
26
|
const unmarshalSource = data => {
|
|
18
27
|
if (!isJSONObject(data)) {
|
|
19
28
|
throw new TypeError(`Unmarshalling the type 'Source' failed as data isn't a dictionary.`);
|
|
@@ -36,6 +45,7 @@ const unmarshalIP = data => {
|
|
|
36
45
|
projectId: data.project_id,
|
|
37
46
|
region: data.region,
|
|
38
47
|
resource: data.resource ? unmarshalResource(data.resource) : undefined,
|
|
48
|
+
reverses: unmarshalArrayOfObject(data.reverses, unmarshalReverse),
|
|
39
49
|
source: unmarshalSource(data.source),
|
|
40
50
|
tags: data.tags,
|
|
41
51
|
updatedAt: unmarshalDate(data.updated_at),
|
|
@@ -70,7 +80,12 @@ const marshalBookIPRequest = (request, defaults) => ({
|
|
|
70
80
|
source: marshalSource(request.source),
|
|
71
81
|
tags: request.tags
|
|
72
82
|
});
|
|
83
|
+
const marshalReverse = (request, defaults) => ({
|
|
84
|
+
address: request.address,
|
|
85
|
+
hostname: request.hostname
|
|
86
|
+
});
|
|
73
87
|
const marshalUpdateIPRequest = (request, defaults) => ({
|
|
88
|
+
reverses: request.reverses !== undefined ? request.reverses.map(elt => marshalReverse(elt)) : undefined,
|
|
74
89
|
tags: request.tags
|
|
75
90
|
});
|
|
76
91
|
|
|
@@ -13,12 +13,26 @@ const jsonContentHeaders = {
|
|
|
13
13
|
class API extends API$1 {
|
|
14
14
|
/** Lists the available regions of the API. */
|
|
15
15
|
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Create a new job definition in a specified Project.
|
|
19
|
+
*
|
|
20
|
+
* @param request - The request {@link CreateJobDefinitionRequest}
|
|
21
|
+
* @returns A Promise of JobDefinition
|
|
22
|
+
*/
|
|
16
23
|
createJobDefinition = request => this.client.fetch({
|
|
17
24
|
body: JSON.stringify(marshalCreateJobDefinitionRequest(request, this.client.settings)),
|
|
18
25
|
headers: jsonContentHeaders,
|
|
19
26
|
method: 'POST',
|
|
20
27
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions`
|
|
21
28
|
}, unmarshalJobDefinition);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get a job definition by its unique identifier.
|
|
32
|
+
*
|
|
33
|
+
* @param request - The request {@link GetJobDefinitionRequest}
|
|
34
|
+
* @returns A Promise of JobDefinition
|
|
35
|
+
*/
|
|
22
36
|
getJobDefinition = request => this.client.fetch({
|
|
23
37
|
method: 'GET',
|
|
24
38
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}`
|
|
@@ -28,27 +42,70 @@ class API extends API$1 {
|
|
|
28
42
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions`,
|
|
29
43
|
urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
30
44
|
}, unmarshalListJobDefinitionsResponse);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* List all your job definitions with filters.
|
|
48
|
+
*
|
|
49
|
+
* @param request - The request {@link ListJobDefinitionsRequest}
|
|
50
|
+
* @returns A Promise of ListJobDefinitionsResponse
|
|
51
|
+
*/
|
|
31
52
|
listJobDefinitions = (request = {}) => enrichForPagination('jobDefinitions', this.pageOfListJobDefinitions, request);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Update an existing job definition associated with the specified unique
|
|
56
|
+
* identifier.
|
|
57
|
+
*
|
|
58
|
+
* @param request - The request {@link UpdateJobDefinitionRequest}
|
|
59
|
+
* @returns A Promise of JobDefinition
|
|
60
|
+
*/
|
|
32
61
|
updateJobDefinition = request => this.client.fetch({
|
|
33
62
|
body: JSON.stringify(marshalUpdateJobDefinitionRequest(request, this.client.settings)),
|
|
34
63
|
headers: jsonContentHeaders,
|
|
35
64
|
method: 'PATCH',
|
|
36
65
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}`
|
|
37
66
|
}, unmarshalJobDefinition);
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Delete an exsisting job definition by its unique identifier.
|
|
70
|
+
*
|
|
71
|
+
* @param request - The request {@link DeleteJobDefinitionRequest}
|
|
72
|
+
*/
|
|
38
73
|
deleteJobDefinition = request => this.client.fetch({
|
|
39
74
|
method: 'DELETE',
|
|
40
75
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}`
|
|
41
76
|
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Run an existing job definition by its unique identifier. This will create a
|
|
80
|
+
* new job run.
|
|
81
|
+
*
|
|
82
|
+
* @param request - The request {@link StartJobDefinitionRequest}
|
|
83
|
+
* @returns A Promise of JobRun
|
|
84
|
+
*/
|
|
42
85
|
startJobDefinition = request => this.client.fetch({
|
|
43
86
|
body: '{}',
|
|
44
87
|
headers: jsonContentHeaders,
|
|
45
88
|
method: 'POST',
|
|
46
89
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}/start`
|
|
47
90
|
}, unmarshalJobRun);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get a job run by its unique identifier.
|
|
94
|
+
*
|
|
95
|
+
* @param request - The request {@link GetJobRunRequest}
|
|
96
|
+
* @returns A Promise of JobRun
|
|
97
|
+
*/
|
|
48
98
|
getJobRun = request => this.client.fetch({
|
|
49
99
|
method: 'GET',
|
|
50
100
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-runs/${validatePathParam('jobRunId', request.jobRunId)}`
|
|
51
101
|
}, unmarshalJobRun);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Stop a job run by its unique identifier.
|
|
105
|
+
*
|
|
106
|
+
* @param request - The request {@link StopJobRunRequest}
|
|
107
|
+
* @returns A Promise of JobRun
|
|
108
|
+
*/
|
|
52
109
|
stopJobRun = request => this.client.fetch({
|
|
53
110
|
body: '{}',
|
|
54
111
|
headers: jsonContentHeaders,
|
|
@@ -60,6 +117,13 @@ class API extends API$1 {
|
|
|
60
117
|
path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-runs`,
|
|
61
118
|
urlParams: urlParams(['job_definition_id', request.jobDefinitionId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
|
|
62
119
|
}, unmarshalListJobRunsResponse);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* List all job runs with filters.
|
|
123
|
+
*
|
|
124
|
+
* @param request - The request {@link ListJobRunsRequest}
|
|
125
|
+
* @returns A Promise of ListJobRunsResponse
|
|
126
|
+
*/
|
|
63
127
|
listJobRuns = (request = {}) => enrichForPagination('jobRuns', this.pageOfListJobRuns, request);
|
|
64
128
|
}
|
|
65
129
|
|
|
@@ -4,6 +4,15 @@ import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshall
|
|
|
4
4
|
|
|
5
5
|
// This file was automatically generated. DO NOT EDIT.
|
|
6
6
|
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
7
|
+
const unmarshalCronSchedule = data => {
|
|
8
|
+
if (!isJSONObject(data)) {
|
|
9
|
+
throw new TypeError(`Unmarshalling the type 'CronSchedule' failed as data isn't a dictionary.`);
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
schedule: data.schedule,
|
|
13
|
+
timezone: data.timezone
|
|
14
|
+
};
|
|
15
|
+
};
|
|
7
16
|
const unmarshalJobDefinition = data => {
|
|
8
17
|
if (!isJSONObject(data)) {
|
|
9
18
|
throw new TypeError(`Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`);
|
|
@@ -12,6 +21,7 @@ const unmarshalJobDefinition = data => {
|
|
|
12
21
|
command: data.command,
|
|
13
22
|
cpuLimit: data.cpu_limit,
|
|
14
23
|
createdAt: unmarshalDate(data.created_at),
|
|
24
|
+
cronSchedule: data.cron_schedule ? unmarshalCronSchedule(data.cron_schedule) : undefined,
|
|
15
25
|
description: data.description,
|
|
16
26
|
environmentVariables: data.environment_variables,
|
|
17
27
|
id: data.id,
|
|
@@ -61,9 +71,14 @@ const unmarshalListJobRunsResponse = data => {
|
|
|
61
71
|
totalCount: data.total_count
|
|
62
72
|
};
|
|
63
73
|
};
|
|
74
|
+
const marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
75
|
+
schedule: request.schedule,
|
|
76
|
+
timezone: request.timezone
|
|
77
|
+
});
|
|
64
78
|
const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
65
79
|
command: request.command,
|
|
66
80
|
cpu_limit: request.cpuLimit,
|
|
81
|
+
cron_schedule: request.cronSchedule !== undefined ? marshalCreateJobDefinitionRequestCronScheduleConfig(request.cronSchedule) : undefined,
|
|
67
82
|
description: request.description,
|
|
68
83
|
environment_variables: request.environmentVariables !== undefined ? request.environmentVariables : undefined,
|
|
69
84
|
image_uri: request.imageUri,
|
|
@@ -72,9 +87,14 @@ const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
|
72
87
|
name: request.name || randomName('job'),
|
|
73
88
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
74
89
|
});
|
|
90
|
+
const marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({
|
|
91
|
+
schedule: request.schedule,
|
|
92
|
+
timezone: request.timezone
|
|
93
|
+
});
|
|
75
94
|
const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
76
95
|
command: request.command,
|
|
77
96
|
cpu_limit: request.cpuLimit,
|
|
97
|
+
cron_schedule: request.cronSchedule !== undefined ? marshalUpdateJobDefinitionRequestCronScheduleConfig(request.cronSchedule) : undefined,
|
|
78
98
|
description: request.description,
|
|
79
99
|
environment_variables: request.environmentVariables,
|
|
80
100
|
image_uri: request.imageUri,
|
|
@@ -15,6 +15,26 @@ const CreateJobDefinitionRequest = {
|
|
|
15
15
|
pattern: /^[A-Za-z0-9-_]{3,50}$/
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
+
const CreateJobDefinitionRequestCronScheduleConfig = {
|
|
19
|
+
schedule: {
|
|
20
|
+
maxLength: 255,
|
|
21
|
+
minLength: 1
|
|
22
|
+
},
|
|
23
|
+
timezone: {
|
|
24
|
+
maxLength: 255,
|
|
25
|
+
minLength: 1
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const CronSchedule = {
|
|
29
|
+
schedule: {
|
|
30
|
+
maxLength: 255,
|
|
31
|
+
minLength: 1
|
|
32
|
+
},
|
|
33
|
+
timezone: {
|
|
34
|
+
maxLength: 255,
|
|
35
|
+
minLength: 1
|
|
36
|
+
}
|
|
37
|
+
};
|
|
18
38
|
const ListJobDefinitionsRequest = {
|
|
19
39
|
page: {
|
|
20
40
|
greaterThanOrEqual: 1
|
|
@@ -47,5 +67,15 @@ const UpdateJobDefinitionRequest = {
|
|
|
47
67
|
pattern: /^[A-Za-z0-9-_]{3,50}$/
|
|
48
68
|
}
|
|
49
69
|
};
|
|
70
|
+
const UpdateJobDefinitionRequestCronScheduleConfig = {
|
|
71
|
+
schedule: {
|
|
72
|
+
maxLength: 255,
|
|
73
|
+
minLength: 1
|
|
74
|
+
},
|
|
75
|
+
timezone: {
|
|
76
|
+
maxLength: 255,
|
|
77
|
+
minLength: 1
|
|
78
|
+
}
|
|
79
|
+
};
|
|
50
80
|
|
|
51
|
-
export { CreateJobDefinitionRequest, ListJobDefinitionsRequest, ListJobRunsRequest, UpdateJobDefinitionRequest };
|
|
81
|
+
export { CreateJobDefinitionRequest, CreateJobDefinitionRequestCronScheduleConfig, CronSchedule, ListJobDefinitionsRequest, ListJobRunsRequest, UpdateJobDefinitionRequest, UpdateJobDefinitionRequestCronScheduleConfig };
|
|
@@ -161,6 +161,16 @@ const unmarshalNode = data => {
|
|
|
161
161
|
updatedAt: unmarshalDate(data.updated_at)
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
|
+
const unmarshalExternalNodeCoreV1Taint = data => {
|
|
165
|
+
if (!isJSONObject(data)) {
|
|
166
|
+
throw new TypeError(`Unmarshalling the type 'ExternalNodeCoreV1Taint' failed as data isn't a dictionary.`);
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
effect: data.effect,
|
|
170
|
+
key: data.key,
|
|
171
|
+
value: data.value
|
|
172
|
+
};
|
|
173
|
+
};
|
|
164
174
|
const unmarshalExternalNode = data => {
|
|
165
175
|
if (!isJSONObject(data)) {
|
|
166
176
|
throw new TypeError(`Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary.`);
|
|
@@ -176,6 +186,7 @@ const unmarshalExternalNode = data => {
|
|
|
176
186
|
kubeletConfig: data.kubelet_config,
|
|
177
187
|
name: data.name,
|
|
178
188
|
nodeLabels: data.node_labels,
|
|
189
|
+
nodeTaints: unmarshalArrayOfObject(data.node_taints, unmarshalExternalNodeCoreV1Taint),
|
|
179
190
|
poolVersion: data.pool_version,
|
|
180
191
|
runcVersion: data.runc_version
|
|
181
192
|
};
|
|
@@ -140,7 +140,7 @@ class ZonedAPI extends API$1 {
|
|
|
140
140
|
* @param request - The request {@link ZonedApiCreateIpRequest}
|
|
141
141
|
* @returns A Promise of Ip
|
|
142
142
|
*/
|
|
143
|
-
createIp =
|
|
143
|
+
createIp = request => this.client.fetch({
|
|
144
144
|
body: JSON.stringify(marshalZonedApiCreateIpRequest(request, this.client.settings)),
|
|
145
145
|
headers: jsonContentHeaders,
|
|
146
146
|
method: 'POST',
|
|
@@ -925,7 +925,7 @@ class API extends API$1 {
|
|
|
925
925
|
* @param request - The request {@link CreateIpRequest}
|
|
926
926
|
* @returns A Promise of Ip
|
|
927
927
|
*/
|
|
928
|
-
createIp =
|
|
928
|
+
createIp = request => this.client.fetch({
|
|
929
929
|
body: JSON.stringify(marshalCreateIpRequest(request, this.client.settings)),
|
|
930
930
|
headers: jsonContentHeaders,
|
|
931
931
|
method: 'POST',
|
|
@@ -629,6 +629,7 @@ const marshalCreateFrontendRequest = (request, defaults) => ({
|
|
|
629
629
|
timeout_client: request.timeoutClient
|
|
630
630
|
});
|
|
631
631
|
const marshalCreateIpRequest = (request, defaults) => ({
|
|
632
|
+
is_ipv6: request.isIpv6,
|
|
632
633
|
reverse: request.reverse,
|
|
633
634
|
...resolveOneOf([{
|
|
634
635
|
default: defaults.defaultProjectId,
|
|
@@ -642,8 +643,10 @@ const marshalCreateIpRequest = (request, defaults) => ({
|
|
|
642
643
|
});
|
|
643
644
|
const marshalCreateLbRequest = (request, defaults) => ({
|
|
644
645
|
assign_flexible_ip: request.assignFlexibleIp,
|
|
646
|
+
assign_flexible_ipv6: request.assignFlexibleIpv6,
|
|
645
647
|
description: request.description,
|
|
646
648
|
ip_id: request.ipId,
|
|
649
|
+
ip_ids: request.ipIds,
|
|
647
650
|
name: request.name || randomName('lb'),
|
|
648
651
|
ssl_compatibility_level: request.sslCompatibilityLevel,
|
|
649
652
|
tags: request.tags,
|
|
@@ -780,6 +783,7 @@ const marshalUpdateHealthCheckRequest = (request, defaults) => ({
|
|
|
780
783
|
}])
|
|
781
784
|
});
|
|
782
785
|
const marshalUpdateIpRequest = (request, defaults) => ({
|
|
786
|
+
lb_id: request.lbId,
|
|
783
787
|
reverse: request.reverse
|
|
784
788
|
});
|
|
785
789
|
const marshalUpdateLbRequest = (request, defaults) => ({
|
|
@@ -867,6 +871,7 @@ const marshalZonedApiCreateFrontendRequest = (request, defaults) => ({
|
|
|
867
871
|
timeout_client: request.timeoutClient
|
|
868
872
|
});
|
|
869
873
|
const marshalZonedApiCreateIpRequest = (request, defaults) => ({
|
|
874
|
+
is_ipv6: request.isIpv6,
|
|
870
875
|
reverse: request.reverse,
|
|
871
876
|
...resolveOneOf([{
|
|
872
877
|
default: defaults.defaultProjectId,
|
|
@@ -880,8 +885,10 @@ const marshalZonedApiCreateIpRequest = (request, defaults) => ({
|
|
|
880
885
|
});
|
|
881
886
|
const marshalZonedApiCreateLbRequest = (request, defaults) => ({
|
|
882
887
|
assign_flexible_ip: request.assignFlexibleIp,
|
|
888
|
+
assign_flexible_ipv6: request.assignFlexibleIpv6,
|
|
883
889
|
description: request.description,
|
|
884
890
|
ip_id: request.ipId,
|
|
891
|
+
ip_ids: request.ipIds,
|
|
885
892
|
name: request.name || randomName('lb'),
|
|
886
893
|
ssl_compatibility_level: request.sslCompatibilityLevel,
|
|
887
894
|
tags: request.tags,
|
|
@@ -1013,6 +1020,7 @@ const marshalZonedApiUpdateHealthCheckRequest = (request, defaults) => ({
|
|
|
1013
1020
|
}])
|
|
1014
1021
|
});
|
|
1015
1022
|
const marshalZonedApiUpdateIpRequest = (request, defaults) => ({
|
|
1023
|
+
lb_id: request.lbId,
|
|
1016
1024
|
reverse: request.reverse
|
|
1017
1025
|
});
|
|
1018
1026
|
const marshalZonedApiUpdateLbRequest = (request, defaults) => ({
|
|
@@ -77,9 +77,9 @@ class API extends API$1 {
|
|
|
77
77
|
}, unmarshalSecret);
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* Update metadata of a secret. Edit a secret's metadata such as name, tag(s)
|
|
81
|
-
* and
|
|
82
|
-
* `region` parameters.
|
|
80
|
+
* Update metadata of a secret. Edit a secret's metadata such as name, tag(s),
|
|
81
|
+
* description and ephemeral policy. The secret to update is specified by the
|
|
82
|
+
* `secret_id` and `region` parameters.
|
|
83
83
|
*
|
|
84
84
|
* @param request - The request {@link UpdateSecretRequest}
|
|
85
85
|
* @returns A Promise of Secret
|
|
@@ -16,6 +16,16 @@ const unmarshalFolder = data => {
|
|
|
16
16
|
region: data.region
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
const unmarshalEphemeralProperties = data => {
|
|
20
|
+
if (!isJSONObject(data)) {
|
|
21
|
+
throw new TypeError(`Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.`);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
action: data.action,
|
|
25
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
26
|
+
expiresOnceAccessed: data.expires_once_accessed
|
|
27
|
+
};
|
|
28
|
+
};
|
|
19
29
|
const unmarshalSecretVersion = data => {
|
|
20
30
|
if (!isJSONObject(data)) {
|
|
21
31
|
throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);
|
|
@@ -23,6 +33,7 @@ const unmarshalSecretVersion = data => {
|
|
|
23
33
|
return {
|
|
24
34
|
createdAt: unmarshalDate(data.created_at),
|
|
25
35
|
description: data.description,
|
|
36
|
+
ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : undefined,
|
|
26
37
|
isLatest: data.is_latest,
|
|
27
38
|
revision: data.revision,
|
|
28
39
|
secretId: data.secret_id,
|
|
@@ -30,6 +41,16 @@ const unmarshalSecretVersion = data => {
|
|
|
30
41
|
updatedAt: unmarshalDate(data.updated_at)
|
|
31
42
|
};
|
|
32
43
|
};
|
|
44
|
+
const unmarshalEphemeralPolicy = data => {
|
|
45
|
+
if (!isJSONObject(data)) {
|
|
46
|
+
throw new TypeError(`Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.`);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
action: data.action,
|
|
50
|
+
expiresOnceAccessed: data.expires_once_accessed,
|
|
51
|
+
timeToLive: data.time_to_live
|
|
52
|
+
};
|
|
53
|
+
};
|
|
33
54
|
const unmarshalSecret = data => {
|
|
34
55
|
if (!isJSONObject(data)) {
|
|
35
56
|
throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
|
|
@@ -37,8 +58,7 @@ const unmarshalSecret = data => {
|
|
|
37
58
|
return {
|
|
38
59
|
createdAt: unmarshalDate(data.created_at),
|
|
39
60
|
description: data.description,
|
|
40
|
-
|
|
41
|
-
expiresAt: unmarshalDate(data.expires_at),
|
|
61
|
+
ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : undefined,
|
|
42
62
|
id: data.id,
|
|
43
63
|
isManaged: data.is_managed,
|
|
44
64
|
isProtected: data.is_protected,
|
|
@@ -109,10 +129,14 @@ const marshalCreateFolderRequest = (request, defaults) => ({
|
|
|
109
129
|
path: request.path,
|
|
110
130
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
111
131
|
});
|
|
132
|
+
const marshalEphemeralPolicy = (request, defaults) => ({
|
|
133
|
+
action: request.action,
|
|
134
|
+
expires_once_accessed: request.expiresOnceAccessed,
|
|
135
|
+
time_to_live: request.timeToLive
|
|
136
|
+
});
|
|
112
137
|
const marshalCreateSecretRequest = (request, defaults) => ({
|
|
113
138
|
description: request.description,
|
|
114
|
-
|
|
115
|
-
expires_at: request.expiresAt,
|
|
139
|
+
ephemeral_policy: request.ephemeralPolicy !== undefined ? marshalEphemeralPolicy(request.ephemeralPolicy) : undefined,
|
|
116
140
|
name: request.name,
|
|
117
141
|
path: request.path,
|
|
118
142
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
@@ -144,12 +168,19 @@ const marshalGeneratePasswordRequest = (request, defaults) => ({
|
|
|
144
168
|
});
|
|
145
169
|
const marshalUpdateSecretRequest = (request, defaults) => ({
|
|
146
170
|
description: request.description,
|
|
171
|
+
ephemeral_policy: request.ephemeralPolicy !== undefined ? marshalEphemeralPolicy(request.ephemeralPolicy) : undefined,
|
|
147
172
|
name: request.name,
|
|
148
173
|
path: request.path,
|
|
149
174
|
tags: request.tags
|
|
150
175
|
});
|
|
176
|
+
const marshalEphemeralProperties = (request, defaults) => ({
|
|
177
|
+
action: request.action,
|
|
178
|
+
expires_at: request.expiresAt,
|
|
179
|
+
expires_once_accessed: request.expiresOnceAccessed
|
|
180
|
+
});
|
|
151
181
|
const marshalUpdateSecretVersionRequest = (request, defaults) => ({
|
|
152
|
-
description: request.description
|
|
182
|
+
description: request.description,
|
|
183
|
+
ephemeral_properties: request.ephemeralProperties !== undefined ? marshalEphemeralProperties(request.ephemeralProperties) : undefined
|
|
153
184
|
});
|
|
154
185
|
|
|
155
|
-
export { marshalAddSecretOwnerRequest, marshalCreateFolderRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalGeneratePasswordRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalFolder, unmarshalListFoldersResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion };
|
|
186
|
+
export { marshalAddSecretOwnerRequest, marshalCreateFolderRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalEphemeralPolicy, marshalGeneratePasswordRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalEphemeralPolicy, unmarshalFolder, unmarshalListFoldersResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalListTagsResponse, unmarshalSecret, unmarshalSecretVersion };
|