@scaleway/sdk 2.16.0 → 2.18.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/marshalling.gen.js +22 -40
- package/dist/api/jobs/v1alpha1/marshalling.gen.js +4 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +6 -0
- package/dist/api/mnq/v1beta1/api.gen.js +3 -3
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1beta1/api.gen.js +253 -0
- package/dist/api/secret/v1beta1/index.gen.js +4 -0
- package/dist/api/secret/v1beta1/marshalling.gen.js +173 -0
- package/dist/api/vpcgw/v1/api.gen.js +15 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +1 -0
- package/dist/index.cjs +1161 -728
- package/dist/index.d.ts +1745 -1117
- package/dist/scw/constants.js +1 -1
- package/package.json +3 -3
|
@@ -17,61 +17,62 @@ const unmarshalReference = data => {
|
|
|
17
17
|
type: data.type
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
const
|
|
20
|
+
const unmarshalSnapshotParentVolume = data => {
|
|
21
21
|
if (!isJSONObject(data)) {
|
|
22
|
-
throw new TypeError(`Unmarshalling the type '
|
|
22
|
+
throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`);
|
|
23
23
|
}
|
|
24
24
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
id: data.id,
|
|
26
|
+
name: data.name,
|
|
27
|
+
status: data.status,
|
|
28
|
+
type: data.type
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
|
-
const
|
|
31
|
+
const unmarshalSnapshot = data => {
|
|
30
32
|
if (!isJSONObject(data)) {
|
|
31
|
-
throw new TypeError(`Unmarshalling the type '
|
|
33
|
+
throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
|
|
32
34
|
}
|
|
33
35
|
return {
|
|
36
|
+
class: data.class,
|
|
34
37
|
createdAt: unmarshalDate(data.created_at),
|
|
35
38
|
id: data.id,
|
|
36
|
-
lastDetachedAt: unmarshalDate(data.last_detached_at),
|
|
37
39
|
name: data.name,
|
|
38
|
-
|
|
40
|
+
parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined,
|
|
39
41
|
projectId: data.project_id,
|
|
40
42
|
references: unmarshalArrayOfObject(data.references, unmarshalReference),
|
|
41
43
|
size: data.size,
|
|
42
|
-
specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
|
|
43
44
|
status: data.status,
|
|
44
45
|
tags: data.tags,
|
|
45
|
-
type: data.type,
|
|
46
46
|
updatedAt: unmarshalDate(data.updated_at),
|
|
47
47
|
zone: data.zone
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
const
|
|
50
|
+
const unmarshalVolumeSpecifications = data => {
|
|
51
51
|
if (!isJSONObject(data)) {
|
|
52
|
-
throw new TypeError(`Unmarshalling the type '
|
|
52
|
+
throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`);
|
|
53
53
|
}
|
|
54
54
|
return {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
status: data.status,
|
|
58
|
-
type: data.type
|
|
55
|
+
class: data.class,
|
|
56
|
+
perfIops: data.perf_iops
|
|
59
57
|
};
|
|
60
58
|
};
|
|
61
|
-
const
|
|
59
|
+
const unmarshalVolume = data => {
|
|
62
60
|
if (!isJSONObject(data)) {
|
|
63
|
-
throw new TypeError(`Unmarshalling the type '
|
|
61
|
+
throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
|
|
64
62
|
}
|
|
65
63
|
return {
|
|
66
|
-
class: data.class,
|
|
67
64
|
createdAt: unmarshalDate(data.created_at),
|
|
68
65
|
id: data.id,
|
|
66
|
+
lastDetachedAt: unmarshalDate(data.last_detached_at),
|
|
69
67
|
name: data.name,
|
|
70
|
-
|
|
68
|
+
parentSnapshotId: data.parent_snapshot_id,
|
|
71
69
|
projectId: data.project_id,
|
|
70
|
+
references: unmarshalArrayOfObject(data.references, unmarshalReference),
|
|
72
71
|
size: data.size,
|
|
72
|
+
specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,
|
|
73
73
|
status: data.status,
|
|
74
74
|
tags: data.tags,
|
|
75
|
+
type: data.type,
|
|
75
76
|
updatedAt: unmarshalDate(data.updated_at),
|
|
76
77
|
zone: data.zone
|
|
77
78
|
};
|
|
@@ -81,7 +82,7 @@ const unmarshalListSnapshotsResponse = data => {
|
|
|
81
82
|
throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
|
|
82
83
|
}
|
|
83
84
|
return {
|
|
84
|
-
snapshots: unmarshalArrayOfObject(data.snapshots,
|
|
85
|
+
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
85
86
|
totalCount: data.total_count
|
|
86
87
|
};
|
|
87
88
|
};
|
|
@@ -114,25 +115,6 @@ const unmarshalListVolumesResponse = data => {
|
|
|
114
115
|
volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume)
|
|
115
116
|
};
|
|
116
117
|
};
|
|
117
|
-
const unmarshalSnapshot = data => {
|
|
118
|
-
if (!isJSONObject(data)) {
|
|
119
|
-
throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
|
|
120
|
-
}
|
|
121
|
-
return {
|
|
122
|
-
class: data.class,
|
|
123
|
-
createdAt: unmarshalDate(data.created_at),
|
|
124
|
-
id: data.id,
|
|
125
|
-
name: data.name,
|
|
126
|
-
parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined,
|
|
127
|
-
projectId: data.project_id,
|
|
128
|
-
references: unmarshalArrayOfObject(data.references, unmarshalReference),
|
|
129
|
-
size: data.size,
|
|
130
|
-
status: data.status,
|
|
131
|
-
tags: data.tags,
|
|
132
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
133
|
-
zone: data.zone
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
118
|
const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
137
119
|
name: request.name,
|
|
138
120
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
@@ -27,6 +27,7 @@ const unmarshalJobDefinition = data => {
|
|
|
27
27
|
id: data.id,
|
|
28
28
|
imageUri: data.image_uri,
|
|
29
29
|
jobTimeout: data.job_timeout,
|
|
30
|
+
localStorageCapacity: data.local_storage_capacity,
|
|
30
31
|
memoryLimit: data.memory_limit,
|
|
31
32
|
name: data.name,
|
|
32
33
|
projectId: data.project_id,
|
|
@@ -47,6 +48,7 @@ const unmarshalJobRun = data => {
|
|
|
47
48
|
exitCode: data.exit_code,
|
|
48
49
|
id: data.id,
|
|
49
50
|
jobDefinitionId: data.job_definition_id,
|
|
51
|
+
localStorageCapacity: data.local_storage_capacity,
|
|
50
52
|
memoryLimit: data.memory_limit,
|
|
51
53
|
region: data.region,
|
|
52
54
|
runDuration: data.run_duration,
|
|
@@ -93,6 +95,7 @@ const marshalCreateJobDefinitionRequest = (request, defaults) => ({
|
|
|
93
95
|
environment_variables: request.environmentVariables !== undefined ? request.environmentVariables : undefined,
|
|
94
96
|
image_uri: request.imageUri,
|
|
95
97
|
job_timeout: request.jobTimeout,
|
|
98
|
+
local_storage_capacity: request.localStorageCapacity,
|
|
96
99
|
memory_limit: request.memoryLimit,
|
|
97
100
|
name: request.name || randomName('job'),
|
|
98
101
|
project_id: request.projectId ?? defaults.defaultProjectId
|
|
@@ -114,6 +117,7 @@ const marshalUpdateJobDefinitionRequest = (request, defaults) => ({
|
|
|
114
117
|
environment_variables: request.environmentVariables,
|
|
115
118
|
image_uri: request.imageUri,
|
|
116
119
|
job_timeout: request.jobTimeout,
|
|
120
|
+
local_storage_capacity: request.localStorageCapacity,
|
|
117
121
|
memory_limit: request.memoryLimit,
|
|
118
122
|
name: request.name
|
|
119
123
|
});
|
|
@@ -8,6 +8,9 @@ const CreateJobDefinitionRequest = {
|
|
|
8
8
|
imageUri: {
|
|
9
9
|
pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
|
|
10
10
|
},
|
|
11
|
+
localStorageCapacity: {
|
|
12
|
+
greaterThan: 0
|
|
13
|
+
},
|
|
11
14
|
memoryLimit: {
|
|
12
15
|
greaterThan: 0
|
|
13
16
|
},
|
|
@@ -65,6 +68,9 @@ const UpdateJobDefinitionRequest = {
|
|
|
65
68
|
imageUri: {
|
|
66
69
|
pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
|
|
67
70
|
},
|
|
71
|
+
localStorageCapacity: {
|
|
72
|
+
greaterThan: 0
|
|
73
|
+
},
|
|
68
74
|
memoryLimit: {
|
|
69
75
|
greaterThan: 0
|
|
70
76
|
},
|
|
@@ -16,7 +16,7 @@ const jsonContentHeaders = {
|
|
|
16
16
|
*/
|
|
17
17
|
class NatsAPI extends API$1 {
|
|
18
18
|
/** Lists the available regions of the API. */
|
|
19
|
-
static LOCALITIES = ['fr-par'];
|
|
19
|
+
static LOCALITIES = ['fr-par', 'nl-ams'];
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Create a NATS account. Create a NATS account associated with a Project.
|
|
@@ -152,7 +152,7 @@ class NatsAPI extends API$1 {
|
|
|
152
152
|
*/
|
|
153
153
|
class SnsAPI extends API$1 {
|
|
154
154
|
/** Lists the available regions of the API. */
|
|
155
|
-
static LOCALITIES = ['fr-par'];
|
|
155
|
+
static LOCALITIES = ['fr-par', 'nl-ams'];
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
158
|
* Activate SNS. Activate SNS for the specified Project ID. SNS must be
|
|
@@ -274,7 +274,7 @@ class SnsAPI extends API$1 {
|
|
|
274
274
|
*/
|
|
275
275
|
class SqsAPI extends API$1 {
|
|
276
276
|
/** Lists the available regions of the API. */
|
|
277
|
-
static LOCALITIES = ['fr-par'];
|
|
277
|
+
static LOCALITIES = ['fr-par', 'nl-ams'];
|
|
278
278
|
|
|
279
279
|
/**
|
|
280
280
|
* Activate SQS. Activate SQS for the specified Project ID. SQS must be
|
package/dist/api/secret/index.js
CHANGED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { API as API$1 } from '../../../scw/api.js';
|
|
2
|
+
import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
|
|
3
|
+
import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
4
|
+
import { marshalCreateSecretRequest, unmarshalSecret, marshalUpdateSecretRequest, unmarshalListSecretsResponse, unmarshalBrowseSecretsResponse, marshalAddSecretOwnerRequest, marshalCreateSecretVersionRequest, unmarshalSecretVersion, marshalUpdateSecretVersionRequest, unmarshalListSecretVersionsResponse, unmarshalAccessSecretVersionResponse } from './marshalling.gen.js';
|
|
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.
|
|
8
|
+
const jsonContentHeaders = {
|
|
9
|
+
'Content-Type': 'application/json; charset=utf-8'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Secret Manager API.
|
|
14
|
+
*
|
|
15
|
+
* This API allows you to conveniently store, access and share sensitive data
|
|
16
|
+
* such as passwords, API keys and certificates.
|
|
17
|
+
*/
|
|
18
|
+
class API extends API$1 {
|
|
19
|
+
/** Lists the available regions of the API. */
|
|
20
|
+
static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Create a secret. You must specify the `region` to create a secret.
|
|
24
|
+
*
|
|
25
|
+
* @param request - The request {@link CreateSecretRequest}
|
|
26
|
+
* @returns A Promise of Secret
|
|
27
|
+
*/
|
|
28
|
+
createSecret = request => this.client.fetch({
|
|
29
|
+
body: JSON.stringify(marshalCreateSecretRequest(request, this.client.settings)),
|
|
30
|
+
headers: jsonContentHeaders,
|
|
31
|
+
method: 'POST',
|
|
32
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`
|
|
33
|
+
}, unmarshalSecret);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get metadata using the secret's ID. Retrieve the metadata of a secret
|
|
37
|
+
* specified by the `region` and `secret_id` parameters.
|
|
38
|
+
*
|
|
39
|
+
* @param request - The request {@link GetSecretRequest}
|
|
40
|
+
* @returns A Promise of Secret
|
|
41
|
+
*/
|
|
42
|
+
getSecret = request => this.client.fetch({
|
|
43
|
+
method: 'GET',
|
|
44
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
45
|
+
}, unmarshalSecret);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Update metadata of a secret. Edit a secret's metadata such as name, tag(s),
|
|
49
|
+
* description and ephemeral policy. The secret to update is specified by the
|
|
50
|
+
* `secret_id` and `region` parameters.
|
|
51
|
+
*
|
|
52
|
+
* @param request - The request {@link UpdateSecretRequest}
|
|
53
|
+
* @returns A Promise of Secret
|
|
54
|
+
*/
|
|
55
|
+
updateSecret = request => this.client.fetch({
|
|
56
|
+
body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),
|
|
57
|
+
headers: jsonContentHeaders,
|
|
58
|
+
method: 'PATCH',
|
|
59
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
60
|
+
}, unmarshalSecret);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Delete a secret. Delete a given secret specified by the `region` and
|
|
64
|
+
* `secret_id` parameters.
|
|
65
|
+
*
|
|
66
|
+
* @param request - The request {@link DeleteSecretRequest}
|
|
67
|
+
*/
|
|
68
|
+
deleteSecret = request => this.client.fetch({
|
|
69
|
+
method: 'DELETE',
|
|
70
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`
|
|
71
|
+
});
|
|
72
|
+
pageOfListSecrets = (request = {}) => this.client.fetch({
|
|
73
|
+
method: 'GET',
|
|
74
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`,
|
|
75
|
+
urlParams: urlParams(['ephemeral', request.ephemeral], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
|
|
76
|
+
}, unmarshalListSecretsResponse);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* List secrets. Retrieve the list of secrets created within an Organization
|
|
80
|
+
* and/or Project. You must specify either the `organization_id` or the
|
|
81
|
+
* `project_id` and the `region`.
|
|
82
|
+
*
|
|
83
|
+
* @param request - The request {@link ListSecretsRequest}
|
|
84
|
+
* @returns A Promise of ListSecretsResponse
|
|
85
|
+
*/
|
|
86
|
+
listSecrets = (request = {}) => enrichForPagination('secrets', this.pageOfListSecrets, request);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Browse secrets. Retrieve the list of secrets and folders for the given
|
|
90
|
+
* prefix. You must specify either the `organization_id` or the `project_id`
|
|
91
|
+
* and the `region`.
|
|
92
|
+
*
|
|
93
|
+
* @param request - The request {@link BrowseSecretsRequest}
|
|
94
|
+
* @returns A Promise of BrowseSecretsResponse
|
|
95
|
+
*/
|
|
96
|
+
browseSecrets = request => this.client.fetch({
|
|
97
|
+
method: 'GET',
|
|
98
|
+
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
|
+
}, unmarshalBrowseSecretsResponse);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Enable secret protection. Enable secret protection for a given secret
|
|
104
|
+
* specified by the `secret_id` parameter. Enabling secret protection means
|
|
105
|
+
* that your secret can be read and modified, but it cannot be deleted.
|
|
106
|
+
*
|
|
107
|
+
* @param request - The request {@link ProtectSecretRequest}
|
|
108
|
+
* @returns A Promise of Secret
|
|
109
|
+
*/
|
|
110
|
+
protectSecret = request => this.client.fetch({
|
|
111
|
+
body: '{}',
|
|
112
|
+
headers: jsonContentHeaders,
|
|
113
|
+
method: 'POST',
|
|
114
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/protect`
|
|
115
|
+
}, unmarshalSecret);
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Disable secret protection. Disable secret protection for a given secret
|
|
119
|
+
* specified by the `secret_id` parameter. Disabling secret protection means
|
|
120
|
+
* that your secret can be read, modified and deleted.
|
|
121
|
+
*
|
|
122
|
+
* @param request - The request {@link UnprotectSecretRequest}
|
|
123
|
+
* @returns A Promise of Secret
|
|
124
|
+
*/
|
|
125
|
+
unprotectSecret = request => this.client.fetch({
|
|
126
|
+
body: '{}',
|
|
127
|
+
headers: jsonContentHeaders,
|
|
128
|
+
method: 'POST',
|
|
129
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/unprotect`
|
|
130
|
+
}, unmarshalSecret);
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Allow a product to use the secret.
|
|
134
|
+
*
|
|
135
|
+
* @param request - The request {@link AddSecretOwnerRequest}
|
|
136
|
+
*/
|
|
137
|
+
addSecretOwner = request => this.client.fetch({
|
|
138
|
+
body: JSON.stringify(marshalAddSecretOwnerRequest(request, this.client.settings)),
|
|
139
|
+
headers: jsonContentHeaders,
|
|
140
|
+
method: 'POST',
|
|
141
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Create a version. Create a version of a given secret specified by the
|
|
146
|
+
* `region` and `secret_id` parameters.
|
|
147
|
+
*
|
|
148
|
+
* @param request - The request {@link CreateSecretVersionRequest}
|
|
149
|
+
* @returns A Promise of SecretVersion
|
|
150
|
+
*/
|
|
151
|
+
createSecretVersion = request => this.client.fetch({
|
|
152
|
+
body: JSON.stringify(marshalCreateSecretVersionRequest(request, this.client.settings)),
|
|
153
|
+
headers: jsonContentHeaders,
|
|
154
|
+
method: 'POST',
|
|
155
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`
|
|
156
|
+
}, unmarshalSecretVersion);
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Get metadata of a secret's version using the secret's ID. Retrieve the
|
|
160
|
+
* metadata of a secret's given version specified by the `region`, `secret_id`
|
|
161
|
+
* and `revision` parameters.
|
|
162
|
+
*
|
|
163
|
+
* @param request - The request {@link GetSecretVersionRequest}
|
|
164
|
+
* @returns A Promise of SecretVersion
|
|
165
|
+
*/
|
|
166
|
+
getSecretVersion = request => this.client.fetch({
|
|
167
|
+
method: 'GET',
|
|
168
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
|
|
169
|
+
}, unmarshalSecretVersion);
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Update metadata of a version. Edit the metadata of a secret's given
|
|
173
|
+
* version, specified by the `region`, `secret_id` and `revision` parameters.
|
|
174
|
+
*
|
|
175
|
+
* @param request - The request {@link UpdateSecretVersionRequest}
|
|
176
|
+
* @returns A Promise of SecretVersion
|
|
177
|
+
*/
|
|
178
|
+
updateSecretVersion = request => this.client.fetch({
|
|
179
|
+
body: JSON.stringify(marshalUpdateSecretVersionRequest(request, this.client.settings)),
|
|
180
|
+
headers: jsonContentHeaders,
|
|
181
|
+
method: 'PATCH',
|
|
182
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
|
|
183
|
+
}, unmarshalSecretVersion);
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Delete a version. Delete a secret's version and the sensitive data
|
|
187
|
+
* contained in it. Deleting a version is permanent and cannot be undone.
|
|
188
|
+
*
|
|
189
|
+
* @param request - The request {@link DeleteSecretVersionRequest}
|
|
190
|
+
*/
|
|
191
|
+
deleteSecretVersion = request => this.client.fetch({
|
|
192
|
+
method: 'DELETE',
|
|
193
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`
|
|
194
|
+
});
|
|
195
|
+
pageOfListSecretVersions = request => this.client.fetch({
|
|
196
|
+
method: 'GET',
|
|
197
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`,
|
|
198
|
+
urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])
|
|
199
|
+
}, unmarshalListSecretVersionsResponse);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* List versions of a secret using the secret's ID. Retrieve the list of a
|
|
203
|
+
* given secret's versions specified by the `secret_id` and `region`
|
|
204
|
+
* parameters.
|
|
205
|
+
*
|
|
206
|
+
* @param request - The request {@link ListSecretVersionsRequest}
|
|
207
|
+
* @returns A Promise of ListSecretVersionsResponse
|
|
208
|
+
*/
|
|
209
|
+
listSecretVersions = request => enrichForPagination('versions', this.pageOfListSecretVersions, request);
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Access a secret's version using the secret's ID. Access sensitive data in a
|
|
213
|
+
* secret's version specified by the `region`, `secret_id` and `revision`
|
|
214
|
+
* parameters.
|
|
215
|
+
*
|
|
216
|
+
* @param request - The request {@link AccessSecretVersionRequest}
|
|
217
|
+
* @returns A Promise of AccessSecretVersionResponse
|
|
218
|
+
*/
|
|
219
|
+
accessSecretVersion = request => this.client.fetch({
|
|
220
|
+
method: 'GET',
|
|
221
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access`
|
|
222
|
+
}, unmarshalAccessSecretVersionResponse);
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Enable a version. Make a specific version accessible. You must specify the
|
|
226
|
+
* `region`, `secret_id` and `revision` parameters.
|
|
227
|
+
*
|
|
228
|
+
* @param request - The request {@link EnableSecretVersionRequest}
|
|
229
|
+
* @returns A Promise of SecretVersion
|
|
230
|
+
*/
|
|
231
|
+
enableSecretVersion = request => this.client.fetch({
|
|
232
|
+
body: '{}',
|
|
233
|
+
headers: jsonContentHeaders,
|
|
234
|
+
method: 'POST',
|
|
235
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/enable`
|
|
236
|
+
}, unmarshalSecretVersion);
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Disable a version. Make a specific version inaccessible. You must specify
|
|
240
|
+
* the `region`, `secret_id` and `revision` parameters.
|
|
241
|
+
*
|
|
242
|
+
* @param request - The request {@link DisableSecretVersionRequest}
|
|
243
|
+
* @returns A Promise of SecretVersion
|
|
244
|
+
*/
|
|
245
|
+
disableSecretVersion = request => this.client.fetch({
|
|
246
|
+
body: '{}',
|
|
247
|
+
headers: jsonContentHeaders,
|
|
248
|
+
method: 'POST',
|
|
249
|
+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/disable`
|
|
250
|
+
}, unmarshalSecretVersion);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export { API };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
2
|
+
import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
|
|
3
|
+
|
|
4
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
5
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
6
|
+
const unmarshalEphemeralProperties = data => {
|
|
7
|
+
if (!isJSONObject(data)) {
|
|
8
|
+
throw new TypeError(`Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.`);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
action: data.action,
|
|
12
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
13
|
+
expiresOnceAccessed: data.expires_once_accessed
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const unmarshalSecretVersion = data => {
|
|
17
|
+
if (!isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
createdAt: unmarshalDate(data.created_at),
|
|
22
|
+
description: data.description,
|
|
23
|
+
ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : undefined,
|
|
24
|
+
latest: data.latest,
|
|
25
|
+
revision: data.revision,
|
|
26
|
+
secretId: data.secret_id,
|
|
27
|
+
status: data.status,
|
|
28
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const unmarshalEphemeralPolicy = data => {
|
|
32
|
+
if (!isJSONObject(data)) {
|
|
33
|
+
throw new TypeError(`Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.`);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
action: data.action,
|
|
37
|
+
expiresOnceAccessed: data.expires_once_accessed,
|
|
38
|
+
timeToLive: data.time_to_live
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const unmarshalSecret = data => {
|
|
42
|
+
if (!isJSONObject(data)) {
|
|
43
|
+
throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
createdAt: unmarshalDate(data.created_at),
|
|
47
|
+
description: data.description,
|
|
48
|
+
ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : undefined,
|
|
49
|
+
id: data.id,
|
|
50
|
+
managed: data.managed,
|
|
51
|
+
name: data.name,
|
|
52
|
+
path: data.path,
|
|
53
|
+
projectId: data.project_id,
|
|
54
|
+
protected: data.protected,
|
|
55
|
+
region: data.region,
|
|
56
|
+
status: data.status,
|
|
57
|
+
tags: data.tags,
|
|
58
|
+
type: data.type,
|
|
59
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
60
|
+
versionCount: data.version_count
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const unmarshalAccessSecretVersionResponse = data => {
|
|
64
|
+
if (!isJSONObject(data)) {
|
|
65
|
+
throw new TypeError(`Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
data: data.data,
|
|
69
|
+
dataCrc32: data.data_crc32,
|
|
70
|
+
revision: data.revision,
|
|
71
|
+
secretId: data.secret_id
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const unmarshalBrowseSecretsResponseItemFolderDetails = data => {
|
|
75
|
+
if (!isJSONObject(data)) {
|
|
76
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItemFolderDetails' failed as data isn't a dictionary.`);
|
|
77
|
+
}
|
|
78
|
+
return {};
|
|
79
|
+
};
|
|
80
|
+
const unmarshalBrowseSecretsResponseItemSecretDetails = data => {
|
|
81
|
+
if (!isJSONObject(data)) {
|
|
82
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItemSecretDetails' failed as data isn't a dictionary.`);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : undefined,
|
|
86
|
+
id: data.id,
|
|
87
|
+
protected: data.protected,
|
|
88
|
+
tags: data.tags,
|
|
89
|
+
versionCount: data.version_count
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const unmarshalBrowseSecretsResponseItem = data => {
|
|
93
|
+
if (!isJSONObject(data)) {
|
|
94
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponseItem' failed as data isn't a dictionary.`);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
createdAt: unmarshalDate(data.created_at),
|
|
98
|
+
folder: data.folder ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) : undefined,
|
|
99
|
+
name: data.name,
|
|
100
|
+
secret: data.secret ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) : undefined,
|
|
101
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const unmarshalBrowseSecretsResponse = data => {
|
|
105
|
+
if (!isJSONObject(data)) {
|
|
106
|
+
throw new TypeError(`Unmarshalling the type 'BrowseSecretsResponse' failed as data isn't a dictionary.`);
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
currentPath: data.current_path,
|
|
110
|
+
items: unmarshalArrayOfObject(data.items, unmarshalBrowseSecretsResponseItem),
|
|
111
|
+
totalCount: data.total_count
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
const unmarshalListSecretVersionsResponse = data => {
|
|
115
|
+
if (!isJSONObject(data)) {
|
|
116
|
+
throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`);
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
totalCount: data.total_count,
|
|
120
|
+
versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const unmarshalListSecretsResponse = data => {
|
|
124
|
+
if (!isJSONObject(data)) {
|
|
125
|
+
throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),
|
|
129
|
+
totalCount: data.total_count
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
const marshalAddSecretOwnerRequest = (request, defaults) => ({
|
|
133
|
+
product: request.product
|
|
134
|
+
});
|
|
135
|
+
const marshalEphemeralPolicy = (request, defaults) => ({
|
|
136
|
+
action: request.action,
|
|
137
|
+
expires_once_accessed: request.expiresOnceAccessed,
|
|
138
|
+
time_to_live: request.timeToLive
|
|
139
|
+
});
|
|
140
|
+
const marshalCreateSecretRequest = (request, defaults) => ({
|
|
141
|
+
description: request.description,
|
|
142
|
+
ephemeral_policy: request.ephemeralPolicy !== undefined ? marshalEphemeralPolicy(request.ephemeralPolicy) : undefined,
|
|
143
|
+
name: request.name,
|
|
144
|
+
path: request.path,
|
|
145
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
146
|
+
protected: request.protected,
|
|
147
|
+
tags: request.tags,
|
|
148
|
+
type: request.type
|
|
149
|
+
});
|
|
150
|
+
const marshalCreateSecretVersionRequest = (request, defaults) => ({
|
|
151
|
+
data: request.data,
|
|
152
|
+
data_crc32: request.dataCrc32,
|
|
153
|
+
description: request.description,
|
|
154
|
+
disable_previous: request.disablePrevious
|
|
155
|
+
});
|
|
156
|
+
const marshalUpdateSecretRequest = (request, defaults) => ({
|
|
157
|
+
description: request.description,
|
|
158
|
+
ephemeral_policy: request.ephemeralPolicy !== undefined ? marshalEphemeralPolicy(request.ephemeralPolicy) : undefined,
|
|
159
|
+
name: request.name,
|
|
160
|
+
path: request.path,
|
|
161
|
+
tags: request.tags
|
|
162
|
+
});
|
|
163
|
+
const marshalEphemeralProperties = (request, defaults) => ({
|
|
164
|
+
action: request.action,
|
|
165
|
+
expires_at: request.expiresAt,
|
|
166
|
+
expires_once_accessed: request.expiresOnceAccessed
|
|
167
|
+
});
|
|
168
|
+
const marshalUpdateSecretVersionRequest = (request, defaults) => ({
|
|
169
|
+
description: request.description,
|
|
170
|
+
ephemeral_properties: request.ephemeralProperties !== undefined ? marshalEphemeralProperties(request.ephemeralProperties) : undefined
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
export { marshalAddSecretOwnerRequest, marshalCreateSecretRequest, marshalCreateSecretVersionRequest, marshalUpdateSecretRequest, marshalUpdateSecretVersionRequest, unmarshalAccessSecretVersionResponse, unmarshalBrowseSecretsResponse, unmarshalListSecretVersionsResponse, unmarshalListSecretsResponse, unmarshalSecret, unmarshalSecretVersion };
|
|
@@ -110,6 +110,21 @@ class API extends API$1 {
|
|
|
110
110
|
method: 'POST',
|
|
111
111
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/upgrade`
|
|
112
112
|
}, unmarshalGateway);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP
|
|
116
|
+
* mobility (move from NAT IP to routed IP). This is idempotent: repeated
|
|
117
|
+
* calls after the first will return no error but have no effect.
|
|
118
|
+
*
|
|
119
|
+
* @param request - The request {@link EnableIPMobilityRequest}
|
|
120
|
+
* @returns A Promise of Gateway
|
|
121
|
+
*/
|
|
122
|
+
enableIPMobility = request => this.client.fetch({
|
|
123
|
+
body: '{}',
|
|
124
|
+
headers: jsonContentHeaders,
|
|
125
|
+
method: 'POST',
|
|
126
|
+
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/enable-ip-mobility`
|
|
127
|
+
}, unmarshalGateway);
|
|
113
128
|
pageOfListGatewayNetworks = (request = {}) => this.client.fetch({
|
|
114
129
|
method: 'GET',
|
|
115
130
|
path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,
|
|
@@ -114,6 +114,7 @@ const unmarshalGateway = data => {
|
|
|
114
114
|
gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
|
|
115
115
|
id: data.id,
|
|
116
116
|
ip: data.ip ? unmarshalIP(data.ip) : undefined,
|
|
117
|
+
ipMobilityEnabled: data.ip_mobility_enabled,
|
|
117
118
|
isLegacy: data.is_legacy,
|
|
118
119
|
name: data.name,
|
|
119
120
|
organizationId: data.organization_id,
|