@ibm-cloud/secrets-manager 2.0.2 → 2.0.4
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/CHANGELOG.md +4 -0
- package/README.md +1 -2
- package/examples/secrets-manager.v2.test.js +3 -1
- package/package.json +2 -2
- package/secrets-manager/v2.d.ts +210 -85
- package/secrets-manager/v2.js +35 -5
- package/secrets-manager/v2.js.map +1 -1
- package/secrets-manager/v1.d.ts +0 -4805
- package/secrets-manager/v1.js +0 -2495
- package/secrets-manager/v1.js.map +0 -1
package/secrets-manager/v1.js
DELETED
|
@@ -1,2495 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* (C) Copyright IBM Corp. 2022.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
* you may not use this file except in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
* See the License for the specific language governing permissions and
|
|
15
|
-
* limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
var __extends = (this && this.__extends) || (function () {
|
|
18
|
-
var extendStatics = function (d, b) {
|
|
19
|
-
extendStatics = Object.setPrototypeOf ||
|
|
20
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
21
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22
|
-
return extendStatics(d, b);
|
|
23
|
-
};
|
|
24
|
-
return function (d, b) {
|
|
25
|
-
if (typeof b !== "function" && b !== null)
|
|
26
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
27
|
-
extendStatics(d, b);
|
|
28
|
-
function __() { this.constructor = d; }
|
|
29
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
30
|
-
};
|
|
31
|
-
})();
|
|
32
|
-
var __assign = (this && this.__assign) || function () {
|
|
33
|
-
__assign = Object.assign || function(t) {
|
|
34
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
35
|
-
s = arguments[i];
|
|
36
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37
|
-
t[p] = s[p];
|
|
38
|
-
}
|
|
39
|
-
return t;
|
|
40
|
-
};
|
|
41
|
-
return __assign.apply(this, arguments);
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* IBM OpenAPI SDK Code Generator Version: 3.60.2-95dc7721-20221102-203229
|
|
45
|
-
*/
|
|
46
|
-
var extend = require("extend");
|
|
47
|
-
var ibm_cloud_sdk_core_1 = require("ibm-cloud-sdk-core");
|
|
48
|
-
var common_1 = require("../lib/common");
|
|
49
|
-
/**
|
|
50
|
-
* With IBM Cloud® Secrets Manager, you can create, lease, and centrally manage secrets that are used in IBM Cloud
|
|
51
|
-
* services or your custom-built applications. Secrets are stored in a dedicated instance of Secrets Manager, which is
|
|
52
|
-
* built on open source HashiCorp Vault.
|
|
53
|
-
*
|
|
54
|
-
* API Version: 1.0.39
|
|
55
|
-
* See: https://cloud.ibm.com/docs/secrets-manager
|
|
56
|
-
*/
|
|
57
|
-
var SecretsManagerV1 = /** @class */ (function (_super) {
|
|
58
|
-
__extends(SecretsManagerV1, _super);
|
|
59
|
-
/**
|
|
60
|
-
* Construct a SecretsManagerV1 object.
|
|
61
|
-
*
|
|
62
|
-
* @param {Object} options - Options for the service.
|
|
63
|
-
* @param {string} [options.serviceUrl] - The base url to use when contacting the service. The base url may differ between IBM Cloud regions.
|
|
64
|
-
* @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service.
|
|
65
|
-
* @param {Authenticator} options.authenticator - The Authenticator object used to authenticate requests to the service
|
|
66
|
-
* @constructor
|
|
67
|
-
* @returns {SecretsManagerV1}
|
|
68
|
-
*/
|
|
69
|
-
function SecretsManagerV1(options) {
|
|
70
|
-
var _this = this;
|
|
71
|
-
options = options || {};
|
|
72
|
-
_this = _super.call(this, options) || this;
|
|
73
|
-
if (options.serviceUrl) {
|
|
74
|
-
_this.setServiceUrl(options.serviceUrl);
|
|
75
|
-
}
|
|
76
|
-
return _this;
|
|
77
|
-
}
|
|
78
|
-
/*************************
|
|
79
|
-
* Factory method
|
|
80
|
-
************************/
|
|
81
|
-
/**
|
|
82
|
-
* Constructs an instance of SecretsManagerV1 with passed in options and external configuration.
|
|
83
|
-
*
|
|
84
|
-
* @param {UserOptions} [options] - The parameters to send to the service.
|
|
85
|
-
* @param {string} [options.serviceName] - The name of the service to configure
|
|
86
|
-
* @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service
|
|
87
|
-
* @param {string} [options.serviceUrl] - The URL for the service
|
|
88
|
-
* @returns {SecretsManagerV1}
|
|
89
|
-
*/
|
|
90
|
-
SecretsManagerV1.newInstance = function (options) {
|
|
91
|
-
options = options || {};
|
|
92
|
-
if (!options.serviceName) {
|
|
93
|
-
options.serviceName = this.DEFAULT_SERVICE_NAME;
|
|
94
|
-
}
|
|
95
|
-
if (!options.authenticator) {
|
|
96
|
-
options.authenticator = (0, ibm_cloud_sdk_core_1.getAuthenticatorFromEnvironment)(options.serviceName);
|
|
97
|
-
}
|
|
98
|
-
var service = new SecretsManagerV1(options);
|
|
99
|
-
service.configureService(options.serviceName);
|
|
100
|
-
if (options.serviceUrl) {
|
|
101
|
-
service.setServiceUrl(options.serviceUrl);
|
|
102
|
-
}
|
|
103
|
-
return service;
|
|
104
|
-
};
|
|
105
|
-
/*************************
|
|
106
|
-
* secretGroups
|
|
107
|
-
************************/
|
|
108
|
-
/**
|
|
109
|
-
* Create a secret group.
|
|
110
|
-
*
|
|
111
|
-
* Create a secret group that you can use to organize secrets and control who on your team has access to them.
|
|
112
|
-
*
|
|
113
|
-
* A successful request returns the ID value of the secret group, along with other metadata. To learn more about
|
|
114
|
-
* secret groups, check out the
|
|
115
|
-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-groups).
|
|
116
|
-
*
|
|
117
|
-
* @param {Object} params - The parameters to send to the service.
|
|
118
|
-
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
119
|
-
* @param {SecretGroupResource[]} params.resources - A collection of resources.
|
|
120
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
121
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
122
|
-
*/
|
|
123
|
-
SecretsManagerV1.prototype.createSecretGroup = function (params) {
|
|
124
|
-
var _params = __assign({}, params);
|
|
125
|
-
var _requiredParams = ['metadata', 'resources'];
|
|
126
|
-
var _validParams = ['metadata', 'resources', 'headers'];
|
|
127
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
128
|
-
if (_validationErrors) {
|
|
129
|
-
return Promise.reject(_validationErrors);
|
|
130
|
-
}
|
|
131
|
-
var body = {
|
|
132
|
-
'metadata': _params.metadata,
|
|
133
|
-
'resources': _params.resources,
|
|
134
|
-
};
|
|
135
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'createSecretGroup');
|
|
136
|
-
var parameters = {
|
|
137
|
-
options: {
|
|
138
|
-
url: '/api/v1/secret_groups',
|
|
139
|
-
method: 'POST',
|
|
140
|
-
body: body,
|
|
141
|
-
},
|
|
142
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
143
|
-
headers: extend(true, sdkHeaders, {
|
|
144
|
-
'Accept': 'application/json',
|
|
145
|
-
'Content-Type': 'application/json',
|
|
146
|
-
}, _params.headers),
|
|
147
|
-
}),
|
|
148
|
-
};
|
|
149
|
-
return this.createRequest(parameters);
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* List secret groups.
|
|
153
|
-
*
|
|
154
|
-
* List the secret groups that are available in your Secrets Manager instance.
|
|
155
|
-
*
|
|
156
|
-
* @param {Object} [params] - The parameters to send to the service.
|
|
157
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
158
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
159
|
-
*/
|
|
160
|
-
SecretsManagerV1.prototype.listSecretGroups = function (params) {
|
|
161
|
-
var _params = __assign({}, params);
|
|
162
|
-
var _requiredParams = [];
|
|
163
|
-
var _validParams = ['headers'];
|
|
164
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
165
|
-
if (_validationErrors) {
|
|
166
|
-
return Promise.reject(_validationErrors);
|
|
167
|
-
}
|
|
168
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listSecretGroups');
|
|
169
|
-
var parameters = {
|
|
170
|
-
options: {
|
|
171
|
-
url: '/api/v1/secret_groups',
|
|
172
|
-
method: 'GET',
|
|
173
|
-
},
|
|
174
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
175
|
-
headers: extend(true, sdkHeaders, {
|
|
176
|
-
'Accept': 'application/json',
|
|
177
|
-
}, _params.headers),
|
|
178
|
-
}),
|
|
179
|
-
};
|
|
180
|
-
return this.createRequest(parameters);
|
|
181
|
-
};
|
|
182
|
-
/**
|
|
183
|
-
* Get a secret group.
|
|
184
|
-
*
|
|
185
|
-
* Get the metadata of an existing secret group by specifying the ID of the group.
|
|
186
|
-
*
|
|
187
|
-
* @param {Object} params - The parameters to send to the service.
|
|
188
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
189
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
190
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
191
|
-
*/
|
|
192
|
-
SecretsManagerV1.prototype.getSecretGroup = function (params) {
|
|
193
|
-
var _params = __assign({}, params);
|
|
194
|
-
var _requiredParams = ['id'];
|
|
195
|
-
var _validParams = ['id', 'headers'];
|
|
196
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
197
|
-
if (_validationErrors) {
|
|
198
|
-
return Promise.reject(_validationErrors);
|
|
199
|
-
}
|
|
200
|
-
var path = {
|
|
201
|
-
'id': _params.id,
|
|
202
|
-
};
|
|
203
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecretGroup');
|
|
204
|
-
var parameters = {
|
|
205
|
-
options: {
|
|
206
|
-
url: '/api/v1/secret_groups/{id}',
|
|
207
|
-
method: 'GET',
|
|
208
|
-
path: path,
|
|
209
|
-
},
|
|
210
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
211
|
-
headers: extend(true, sdkHeaders, {
|
|
212
|
-
'Accept': 'application/json',
|
|
213
|
-
}, _params.headers),
|
|
214
|
-
}),
|
|
215
|
-
};
|
|
216
|
-
return this.createRequest(parameters);
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* Update a secret group.
|
|
220
|
-
*
|
|
221
|
-
* Update the metadata of an existing secret group, such as its name or description.
|
|
222
|
-
*
|
|
223
|
-
* @param {Object} params - The parameters to send to the service.
|
|
224
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
225
|
-
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
226
|
-
* @param {SecretGroupMetadataUpdatable[]} params.resources - A collection of resources.
|
|
227
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
228
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretGroupDef>>}
|
|
229
|
-
*/
|
|
230
|
-
SecretsManagerV1.prototype.updateSecretGroupMetadata = function (params) {
|
|
231
|
-
var _params = __assign({}, params);
|
|
232
|
-
var _requiredParams = ['id', 'metadata', 'resources'];
|
|
233
|
-
var _validParams = ['id', 'metadata', 'resources', 'headers'];
|
|
234
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
235
|
-
if (_validationErrors) {
|
|
236
|
-
return Promise.reject(_validationErrors);
|
|
237
|
-
}
|
|
238
|
-
var body = {
|
|
239
|
-
'metadata': _params.metadata,
|
|
240
|
-
'resources': _params.resources,
|
|
241
|
-
};
|
|
242
|
-
var path = {
|
|
243
|
-
'id': _params.id,
|
|
244
|
-
};
|
|
245
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'updateSecretGroupMetadata');
|
|
246
|
-
var parameters = {
|
|
247
|
-
options: {
|
|
248
|
-
url: '/api/v1/secret_groups/{id}',
|
|
249
|
-
method: 'PUT',
|
|
250
|
-
body: body,
|
|
251
|
-
path: path,
|
|
252
|
-
},
|
|
253
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
254
|
-
headers: extend(true, sdkHeaders, {
|
|
255
|
-
'Accept': 'application/json',
|
|
256
|
-
'Content-Type': 'application/json',
|
|
257
|
-
}, _params.headers),
|
|
258
|
-
}),
|
|
259
|
-
};
|
|
260
|
-
return this.createRequest(parameters);
|
|
261
|
-
};
|
|
262
|
-
/**
|
|
263
|
-
* Delete a secret group.
|
|
264
|
-
*
|
|
265
|
-
* Delete a secret group by specifying the ID of the secret group.
|
|
266
|
-
*
|
|
267
|
-
* **Note:** To delete a secret group, it must be empty. If you need to remove a secret group that contains secrets,
|
|
268
|
-
* you must first [delete the secrets](#delete-secret) that are associated with the group.
|
|
269
|
-
*
|
|
270
|
-
* @param {Object} params - The parameters to send to the service.
|
|
271
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret group.
|
|
272
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
273
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.EmptyObject>>}
|
|
274
|
-
*/
|
|
275
|
-
SecretsManagerV1.prototype.deleteSecretGroup = function (params) {
|
|
276
|
-
var _params = __assign({}, params);
|
|
277
|
-
var _requiredParams = ['id'];
|
|
278
|
-
var _validParams = ['id', 'headers'];
|
|
279
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
280
|
-
if (_validationErrors) {
|
|
281
|
-
return Promise.reject(_validationErrors);
|
|
282
|
-
}
|
|
283
|
-
var path = {
|
|
284
|
-
'id': _params.id,
|
|
285
|
-
};
|
|
286
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteSecretGroup');
|
|
287
|
-
var parameters = {
|
|
288
|
-
options: {
|
|
289
|
-
url: '/api/v1/secret_groups/{id}',
|
|
290
|
-
method: 'DELETE',
|
|
291
|
-
path: path,
|
|
292
|
-
},
|
|
293
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
294
|
-
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
295
|
-
}),
|
|
296
|
-
};
|
|
297
|
-
return this.createRequest(parameters);
|
|
298
|
-
};
|
|
299
|
-
/*************************
|
|
300
|
-
* secrets
|
|
301
|
-
************************/
|
|
302
|
-
/**
|
|
303
|
-
* Create a secret.
|
|
304
|
-
*
|
|
305
|
-
* Create a secret or import an existing value that you can use to access or authenticate to a protected resource.
|
|
306
|
-
*
|
|
307
|
-
* Use this method to either generate or import an existing secret, such as an arbitrary value or a TLS certificate,
|
|
308
|
-
* that you can manage in your Secrets Manager service instance. A successful request stores the secret in your
|
|
309
|
-
* dedicated instance based on the secret type and data that you specify. The response returns the ID value of the
|
|
310
|
-
* secret, along with other metadata.
|
|
311
|
-
*
|
|
312
|
-
* To learn more about the types of secrets that you can create with Secrets Manager, check out the
|
|
313
|
-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-what-is-secret).
|
|
314
|
-
*
|
|
315
|
-
* @param {Object} params - The parameters to send to the service.
|
|
316
|
-
* @param {string} params.secretType - The secret type.
|
|
317
|
-
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
318
|
-
* @param {SecretResource[]} params.resources - A collection of resources.
|
|
319
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
320
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.CreateSecret>>}
|
|
321
|
-
*/
|
|
322
|
-
SecretsManagerV1.prototype.createSecret = function (params) {
|
|
323
|
-
var _params = __assign({}, params);
|
|
324
|
-
var _requiredParams = ['secretType', 'metadata', 'resources'];
|
|
325
|
-
var _validParams = ['secretType', 'metadata', 'resources', 'headers'];
|
|
326
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
327
|
-
if (_validationErrors) {
|
|
328
|
-
return Promise.reject(_validationErrors);
|
|
329
|
-
}
|
|
330
|
-
var body = {
|
|
331
|
-
'metadata': _params.metadata,
|
|
332
|
-
'resources': _params.resources,
|
|
333
|
-
};
|
|
334
|
-
var path = {
|
|
335
|
-
'secret_type': _params.secretType,
|
|
336
|
-
};
|
|
337
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'createSecret');
|
|
338
|
-
var parameters = {
|
|
339
|
-
options: {
|
|
340
|
-
url: '/api/v1/secrets/{secret_type}',
|
|
341
|
-
method: 'POST',
|
|
342
|
-
body: body,
|
|
343
|
-
path: path,
|
|
344
|
-
},
|
|
345
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
346
|
-
headers: extend(true, sdkHeaders, {
|
|
347
|
-
'Accept': 'application/json',
|
|
348
|
-
'Content-Type': 'application/json',
|
|
349
|
-
}, _params.headers),
|
|
350
|
-
}),
|
|
351
|
-
};
|
|
352
|
-
return this.createRequest(parameters);
|
|
353
|
-
};
|
|
354
|
-
/**
|
|
355
|
-
* List secrets by type.
|
|
356
|
-
*
|
|
357
|
-
* List the secrets in your Secrets Manager instance based on the type that you specify.
|
|
358
|
-
*
|
|
359
|
-
* @param {Object} params - The parameters to send to the service.
|
|
360
|
-
* @param {string} params.secretType - The secret type.
|
|
361
|
-
* @param {number} [params.limit] - The number of secrets to retrieve. By default, list operations return the first
|
|
362
|
-
* 200 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
|
|
363
|
-
* resources.
|
|
364
|
-
*
|
|
365
|
-
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
366
|
-
* `../secrets/{secret_type}?limit=5`.
|
|
367
|
-
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
368
|
-
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
369
|
-
*
|
|
370
|
-
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
371
|
-
* `..?offset=25&limit=25`.
|
|
372
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
373
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
|
|
374
|
-
*/
|
|
375
|
-
SecretsManagerV1.prototype.listSecrets = function (params) {
|
|
376
|
-
var _params = __assign({}, params);
|
|
377
|
-
var _requiredParams = ['secretType'];
|
|
378
|
-
var _validParams = ['secretType', 'limit', 'offset', 'headers'];
|
|
379
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
380
|
-
if (_validationErrors) {
|
|
381
|
-
return Promise.reject(_validationErrors);
|
|
382
|
-
}
|
|
383
|
-
var query = {
|
|
384
|
-
'limit': _params.limit,
|
|
385
|
-
'offset': _params.offset,
|
|
386
|
-
};
|
|
387
|
-
var path = {
|
|
388
|
-
'secret_type': _params.secretType,
|
|
389
|
-
};
|
|
390
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listSecrets');
|
|
391
|
-
var parameters = {
|
|
392
|
-
options: {
|
|
393
|
-
url: '/api/v1/secrets/{secret_type}',
|
|
394
|
-
method: 'GET',
|
|
395
|
-
qs: query,
|
|
396
|
-
path: path,
|
|
397
|
-
},
|
|
398
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
399
|
-
headers: extend(true, sdkHeaders, {
|
|
400
|
-
'Accept': 'application/json',
|
|
401
|
-
}, _params.headers),
|
|
402
|
-
}),
|
|
403
|
-
};
|
|
404
|
-
return this.createRequest(parameters);
|
|
405
|
-
};
|
|
406
|
-
/**
|
|
407
|
-
* List all secrets.
|
|
408
|
-
*
|
|
409
|
-
* List all of the secrets in your Secrets Manager instance.
|
|
410
|
-
*
|
|
411
|
-
* @param {Object} [params] - The parameters to send to the service.
|
|
412
|
-
* @param {number} [params.limit] - The number of secrets to retrieve. By default, list operations return the first
|
|
413
|
-
* 200 items. To retrieve a different set of items, use `limit` with `offset` to page through your available
|
|
414
|
-
* resources.
|
|
415
|
-
*
|
|
416
|
-
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5 secrets, use
|
|
417
|
-
* `../secrets/{secret_type}?limit=5`.
|
|
418
|
-
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
419
|
-
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
420
|
-
*
|
|
421
|
-
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
422
|
-
* `..?offset=25&limit=25`.
|
|
423
|
-
* @param {string} [params.search] - Filter secrets that contain the specified string. The fields that are searched
|
|
424
|
-
* include: id, name, description, labels, secret_type.
|
|
425
|
-
*
|
|
426
|
-
* **Usage:** If you want to list only the secrets that contain the string "text", use
|
|
427
|
-
* `../secrets/{secret_type}?search=text`.
|
|
428
|
-
* @param {string} [params.sortBy] - Sort a list of secrets by the specified field.
|
|
429
|
-
*
|
|
430
|
-
* **Usage:** To sort a list of secrets by their creation date, use
|
|
431
|
-
* `../secrets/{secret_type}?sort_by=creation_date`.
|
|
432
|
-
* @param {string[]} [params.groups] - Filter secrets by groups.
|
|
433
|
-
*
|
|
434
|
-
* You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter secrets
|
|
435
|
-
* that are in the default secret group, use the `default` keyword.
|
|
436
|
-
*
|
|
437
|
-
* **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
|
|
438
|
-
* use `..?groups={secret_group_ID},default`.
|
|
439
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
440
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecrets>>}
|
|
441
|
-
*/
|
|
442
|
-
SecretsManagerV1.prototype.listAllSecrets = function (params) {
|
|
443
|
-
var _params = __assign({}, params);
|
|
444
|
-
var _requiredParams = [];
|
|
445
|
-
var _validParams = ['limit', 'offset', 'search', 'sortBy', 'groups', 'headers'];
|
|
446
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
447
|
-
if (_validationErrors) {
|
|
448
|
-
return Promise.reject(_validationErrors);
|
|
449
|
-
}
|
|
450
|
-
var query = {
|
|
451
|
-
'limit': _params.limit,
|
|
452
|
-
'offset': _params.offset,
|
|
453
|
-
'search': _params.search,
|
|
454
|
-
'sort_by': _params.sortBy,
|
|
455
|
-
'groups': _params.groups,
|
|
456
|
-
};
|
|
457
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listAllSecrets');
|
|
458
|
-
var parameters = {
|
|
459
|
-
options: {
|
|
460
|
-
url: '/api/v1/secrets',
|
|
461
|
-
method: 'GET',
|
|
462
|
-
qs: query,
|
|
463
|
-
},
|
|
464
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
465
|
-
headers: extend(true, sdkHeaders, {
|
|
466
|
-
'Accept': 'application/json',
|
|
467
|
-
}, _params.headers),
|
|
468
|
-
}),
|
|
469
|
-
};
|
|
470
|
-
return this.createRequest(parameters);
|
|
471
|
-
};
|
|
472
|
-
/**
|
|
473
|
-
* Get a secret.
|
|
474
|
-
*
|
|
475
|
-
* Get a secret and its details by specifying the ID of the secret.
|
|
476
|
-
*
|
|
477
|
-
* A successful request returns the secret data that is associated with your secret, along with other metadata. To
|
|
478
|
-
* view only the details of a specified secret without retrieving its value, use the [Get secret
|
|
479
|
-
* metadata](#get-secret-metadata) method.
|
|
480
|
-
*
|
|
481
|
-
* @param {Object} params - The parameters to send to the service.
|
|
482
|
-
* @param {string} params.secretType - The secret type.
|
|
483
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
484
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
485
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>}
|
|
486
|
-
*/
|
|
487
|
-
SecretsManagerV1.prototype.getSecret = function (params) {
|
|
488
|
-
var _params = __assign({}, params);
|
|
489
|
-
var _requiredParams = ['secretType', 'id'];
|
|
490
|
-
var _validParams = ['secretType', 'id', 'headers'];
|
|
491
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
492
|
-
if (_validationErrors) {
|
|
493
|
-
return Promise.reject(_validationErrors);
|
|
494
|
-
}
|
|
495
|
-
var path = {
|
|
496
|
-
'secret_type': _params.secretType,
|
|
497
|
-
'id': _params.id,
|
|
498
|
-
};
|
|
499
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecret');
|
|
500
|
-
var parameters = {
|
|
501
|
-
options: {
|
|
502
|
-
url: '/api/v1/secrets/{secret_type}/{id}',
|
|
503
|
-
method: 'GET',
|
|
504
|
-
path: path,
|
|
505
|
-
},
|
|
506
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
507
|
-
headers: extend(true, sdkHeaders, {
|
|
508
|
-
'Accept': 'application/json',
|
|
509
|
-
}, _params.headers),
|
|
510
|
-
}),
|
|
511
|
-
};
|
|
512
|
-
return this.createRequest(parameters);
|
|
513
|
-
};
|
|
514
|
-
/**
|
|
515
|
-
* Invoke an action on a secret.
|
|
516
|
-
*
|
|
517
|
-
* Invoke an action on a specified secret. This method supports the following actions:
|
|
518
|
-
*
|
|
519
|
-
* - `rotate`: Replace the value of a secret.
|
|
520
|
-
* - `restore`: Restore a previous version of an `iam_credentials` secret.
|
|
521
|
-
* - `revoke`: Revoke a private certificate.
|
|
522
|
-
* - `delete_credentials`: Delete the API key that is associated with an `iam_credentials` secret.
|
|
523
|
-
* - `validate_dns_challenge`: Validate challenges for a public certificate that is ordered with a manual DNS
|
|
524
|
-
* provider.
|
|
525
|
-
*
|
|
526
|
-
* @param {Object} params - The parameters to send to the service.
|
|
527
|
-
* @param {string} params.secretType - The secret type.
|
|
528
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
529
|
-
* @param {string} params.action - The action to perform on the specified secret.
|
|
530
|
-
* @param {SecretAction} [params.secretAction] - The properties to update for the secret.
|
|
531
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
532
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>}
|
|
533
|
-
*/
|
|
534
|
-
SecretsManagerV1.prototype.updateSecret = function (params) {
|
|
535
|
-
var _params = __assign({}, params);
|
|
536
|
-
var _requiredParams = ['secretType', 'id', 'action'];
|
|
537
|
-
var _validParams = ['secretType', 'id', 'action', 'secretAction', 'headers'];
|
|
538
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
539
|
-
if (_validationErrors) {
|
|
540
|
-
return Promise.reject(_validationErrors);
|
|
541
|
-
}
|
|
542
|
-
var body = _params.secretAction;
|
|
543
|
-
var query = {
|
|
544
|
-
'action': _params.action,
|
|
545
|
-
};
|
|
546
|
-
var path = {
|
|
547
|
-
'secret_type': _params.secretType,
|
|
548
|
-
'id': _params.id,
|
|
549
|
-
};
|
|
550
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'updateSecret');
|
|
551
|
-
var parameters = {
|
|
552
|
-
options: {
|
|
553
|
-
url: '/api/v1/secrets/{secret_type}/{id}',
|
|
554
|
-
method: 'POST',
|
|
555
|
-
body: body,
|
|
556
|
-
qs: query,
|
|
557
|
-
path: path,
|
|
558
|
-
},
|
|
559
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
560
|
-
headers: extend(true, sdkHeaders, {
|
|
561
|
-
'Accept': 'application/json',
|
|
562
|
-
'Content-Type': 'application/json',
|
|
563
|
-
}, _params.headers),
|
|
564
|
-
}),
|
|
565
|
-
};
|
|
566
|
-
return this.createRequest(parameters);
|
|
567
|
-
};
|
|
568
|
-
/**
|
|
569
|
-
* Delete a secret.
|
|
570
|
-
*
|
|
571
|
-
* Delete a secret by specifying the ID of the secret.
|
|
572
|
-
*
|
|
573
|
-
* @param {Object} params - The parameters to send to the service.
|
|
574
|
-
* @param {string} params.secretType - The secret type.
|
|
575
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
576
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
577
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.EmptyObject>>}
|
|
578
|
-
*/
|
|
579
|
-
SecretsManagerV1.prototype.deleteSecret = function (params) {
|
|
580
|
-
var _params = __assign({}, params);
|
|
581
|
-
var _requiredParams = ['secretType', 'id'];
|
|
582
|
-
var _validParams = ['secretType', 'id', 'headers'];
|
|
583
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
584
|
-
if (_validationErrors) {
|
|
585
|
-
return Promise.reject(_validationErrors);
|
|
586
|
-
}
|
|
587
|
-
var path = {
|
|
588
|
-
'secret_type': _params.secretType,
|
|
589
|
-
'id': _params.id,
|
|
590
|
-
};
|
|
591
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteSecret');
|
|
592
|
-
var parameters = {
|
|
593
|
-
options: {
|
|
594
|
-
url: '/api/v1/secrets/{secret_type}/{id}',
|
|
595
|
-
method: 'DELETE',
|
|
596
|
-
path: path,
|
|
597
|
-
},
|
|
598
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
599
|
-
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
600
|
-
}),
|
|
601
|
-
};
|
|
602
|
-
return this.createRequest(parameters);
|
|
603
|
-
};
|
|
604
|
-
/**
|
|
605
|
-
* List versions of a secret.
|
|
606
|
-
*
|
|
607
|
-
* List the versions of a secret.
|
|
608
|
-
*
|
|
609
|
-
* A successful request returns the list of the versions along with the metadata of each version.
|
|
610
|
-
*
|
|
611
|
-
* @param {Object} params - The parameters to send to the service.
|
|
612
|
-
* @param {string} params.secretType - The secret type.
|
|
613
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
614
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
615
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretVersions>>}
|
|
616
|
-
*/
|
|
617
|
-
SecretsManagerV1.prototype.listSecretVersions = function (params) {
|
|
618
|
-
var _params = __assign({}, params);
|
|
619
|
-
var _requiredParams = ['secretType', 'id'];
|
|
620
|
-
var _validParams = ['secretType', 'id', 'headers'];
|
|
621
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
622
|
-
if (_validationErrors) {
|
|
623
|
-
return Promise.reject(_validationErrors);
|
|
624
|
-
}
|
|
625
|
-
var path = {
|
|
626
|
-
'secret_type': _params.secretType,
|
|
627
|
-
'id': _params.id,
|
|
628
|
-
};
|
|
629
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listSecretVersions');
|
|
630
|
-
var parameters = {
|
|
631
|
-
options: {
|
|
632
|
-
url: '/api/v1/secrets/{secret_type}/{id}/versions',
|
|
633
|
-
method: 'GET',
|
|
634
|
-
path: path,
|
|
635
|
-
},
|
|
636
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
637
|
-
headers: extend(true, sdkHeaders, {
|
|
638
|
-
'Accept': 'application/json',
|
|
639
|
-
}, _params.headers),
|
|
640
|
-
}),
|
|
641
|
-
};
|
|
642
|
-
return this.createRequest(parameters);
|
|
643
|
-
};
|
|
644
|
-
/**
|
|
645
|
-
* Get a version of a secret.
|
|
646
|
-
*
|
|
647
|
-
* Get a version of a secret by specifying the ID of the version or the alias `previous`.
|
|
648
|
-
*
|
|
649
|
-
* A successful request returns the secret data that is associated with the specified version of your secret, along
|
|
650
|
-
* with other metadata.
|
|
651
|
-
*
|
|
652
|
-
* @param {Object} params - The parameters to send to the service.
|
|
653
|
-
* @param {string} params.secretType - The secret type.
|
|
654
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
655
|
-
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
656
|
-
* `previous` to retrieve the previous version.
|
|
657
|
-
*
|
|
658
|
-
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
659
|
-
* the response details.
|
|
660
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
661
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretVersion>>}
|
|
662
|
-
*/
|
|
663
|
-
SecretsManagerV1.prototype.getSecretVersion = function (params) {
|
|
664
|
-
var _params = __assign({}, params);
|
|
665
|
-
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
666
|
-
var _validParams = ['secretType', 'id', 'versionId', 'headers'];
|
|
667
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
668
|
-
if (_validationErrors) {
|
|
669
|
-
return Promise.reject(_validationErrors);
|
|
670
|
-
}
|
|
671
|
-
var path = {
|
|
672
|
-
'secret_type': _params.secretType,
|
|
673
|
-
'id': _params.id,
|
|
674
|
-
'version_id': _params.versionId,
|
|
675
|
-
};
|
|
676
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecretVersion');
|
|
677
|
-
var parameters = {
|
|
678
|
-
options: {
|
|
679
|
-
url: '/api/v1/secrets/{secret_type}/{id}/versions/{version_id}',
|
|
680
|
-
method: 'GET',
|
|
681
|
-
path: path,
|
|
682
|
-
},
|
|
683
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
684
|
-
headers: extend(true, sdkHeaders, {
|
|
685
|
-
'Accept': 'application/json',
|
|
686
|
-
}, _params.headers),
|
|
687
|
-
}),
|
|
688
|
-
};
|
|
689
|
-
return this.createRequest(parameters);
|
|
690
|
-
};
|
|
691
|
-
/**
|
|
692
|
-
* Invoke an action on a version of a secret.
|
|
693
|
-
*
|
|
694
|
-
* Invoke an action on a specified version of a secret. This method supports the following actions:
|
|
695
|
-
*
|
|
696
|
-
* - `revoke`: Revoke a version of a private certificate.
|
|
697
|
-
*
|
|
698
|
-
* @param {Object} params - The parameters to send to the service.
|
|
699
|
-
* @param {string} params.secretType - The secret type.
|
|
700
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
701
|
-
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
702
|
-
* `previous` to retrieve the previous version.
|
|
703
|
-
*
|
|
704
|
-
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
705
|
-
* the response details.
|
|
706
|
-
* @param {string} params.action - The action to perform on the specified secret version.
|
|
707
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
708
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecret>>}
|
|
709
|
-
*/
|
|
710
|
-
SecretsManagerV1.prototype.updateSecretVersion = function (params) {
|
|
711
|
-
var _params = __assign({}, params);
|
|
712
|
-
var _requiredParams = ['secretType', 'id', 'versionId', 'action'];
|
|
713
|
-
var _validParams = ['secretType', 'id', 'versionId', 'action', 'headers'];
|
|
714
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
715
|
-
if (_validationErrors) {
|
|
716
|
-
return Promise.reject(_validationErrors);
|
|
717
|
-
}
|
|
718
|
-
var query = {
|
|
719
|
-
'action': _params.action,
|
|
720
|
-
};
|
|
721
|
-
var path = {
|
|
722
|
-
'secret_type': _params.secretType,
|
|
723
|
-
'id': _params.id,
|
|
724
|
-
'version_id': _params.versionId,
|
|
725
|
-
};
|
|
726
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'updateSecretVersion');
|
|
727
|
-
var parameters = {
|
|
728
|
-
options: {
|
|
729
|
-
url: '/api/v1/secrets/{secret_type}/{id}/versions/{version_id}',
|
|
730
|
-
method: 'POST',
|
|
731
|
-
qs: query,
|
|
732
|
-
path: path,
|
|
733
|
-
},
|
|
734
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
735
|
-
headers: extend(true, sdkHeaders, {
|
|
736
|
-
'Accept': 'application/json',
|
|
737
|
-
}, _params.headers),
|
|
738
|
-
}),
|
|
739
|
-
};
|
|
740
|
-
return this.createRequest(parameters);
|
|
741
|
-
};
|
|
742
|
-
/**
|
|
743
|
-
* Get the metadata of a secret version.
|
|
744
|
-
*
|
|
745
|
-
* Get the metadata of a secret version by specifying the ID of the version or the alias `previous`.
|
|
746
|
-
*
|
|
747
|
-
* A successful request returns the metadata that is associated with the specified version of your secret.
|
|
748
|
-
*
|
|
749
|
-
* @param {Object} params - The parameters to send to the service.
|
|
750
|
-
* @param {string} params.secretType - The secret type.
|
|
751
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
752
|
-
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
753
|
-
* `previous` to retrieve the previous version.
|
|
754
|
-
*
|
|
755
|
-
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
756
|
-
* the response details.
|
|
757
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
758
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretVersionMetadata>>}
|
|
759
|
-
*/
|
|
760
|
-
SecretsManagerV1.prototype.getSecretVersionMetadata = function (params) {
|
|
761
|
-
var _params = __assign({}, params);
|
|
762
|
-
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
763
|
-
var _validParams = ['secretType', 'id', 'versionId', 'headers'];
|
|
764
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
765
|
-
if (_validationErrors) {
|
|
766
|
-
return Promise.reject(_validationErrors);
|
|
767
|
-
}
|
|
768
|
-
var path = {
|
|
769
|
-
'secret_type': _params.secretType,
|
|
770
|
-
'id': _params.id,
|
|
771
|
-
'version_id': _params.versionId,
|
|
772
|
-
};
|
|
773
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecretVersionMetadata');
|
|
774
|
-
var parameters = {
|
|
775
|
-
options: {
|
|
776
|
-
url: '/api/v1/secrets/{secret_type}/{id}/versions/{version_id}/metadata',
|
|
777
|
-
method: 'GET',
|
|
778
|
-
path: path,
|
|
779
|
-
},
|
|
780
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
781
|
-
headers: extend(true, sdkHeaders, {
|
|
782
|
-
'Accept': 'application/json',
|
|
783
|
-
}, _params.headers),
|
|
784
|
-
}),
|
|
785
|
-
};
|
|
786
|
-
return this.createRequest(parameters);
|
|
787
|
-
};
|
|
788
|
-
/**
|
|
789
|
-
* Update the metadata of a secret version.
|
|
790
|
-
*
|
|
791
|
-
* Update the metadata of a secret version, such as `version_custom_metadata`.
|
|
792
|
-
*
|
|
793
|
-
* @param {Object} params - The parameters to send to the service.
|
|
794
|
-
* @param {string} params.secretType - The secret type.
|
|
795
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
796
|
-
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
797
|
-
* `previous` to retrieve the previous version.
|
|
798
|
-
*
|
|
799
|
-
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
800
|
-
* the response details.
|
|
801
|
-
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
802
|
-
* @param {UpdateSecretVersionMetadata[]} params.resources - A collection of resources.
|
|
803
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
804
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretVersionMetadata>>}
|
|
805
|
-
*/
|
|
806
|
-
SecretsManagerV1.prototype.updateSecretVersionMetadata = function (params) {
|
|
807
|
-
var _params = __assign({}, params);
|
|
808
|
-
var _requiredParams = ['secretType', 'id', 'versionId', 'metadata', 'resources'];
|
|
809
|
-
var _validParams = ['secretType', 'id', 'versionId', 'metadata', 'resources', 'headers'];
|
|
810
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
811
|
-
if (_validationErrors) {
|
|
812
|
-
return Promise.reject(_validationErrors);
|
|
813
|
-
}
|
|
814
|
-
var body = {
|
|
815
|
-
'metadata': _params.metadata,
|
|
816
|
-
'resources': _params.resources,
|
|
817
|
-
};
|
|
818
|
-
var path = {
|
|
819
|
-
'secret_type': _params.secretType,
|
|
820
|
-
'id': _params.id,
|
|
821
|
-
'version_id': _params.versionId,
|
|
822
|
-
};
|
|
823
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'updateSecretVersionMetadata');
|
|
824
|
-
var parameters = {
|
|
825
|
-
options: {
|
|
826
|
-
url: '/api/v1/secrets/{secret_type}/{id}/versions/{version_id}/metadata',
|
|
827
|
-
method: 'PUT',
|
|
828
|
-
body: body,
|
|
829
|
-
path: path,
|
|
830
|
-
},
|
|
831
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
832
|
-
headers: extend(true, sdkHeaders, {
|
|
833
|
-
'Accept': 'application/json',
|
|
834
|
-
'Content-Type': 'application/json',
|
|
835
|
-
}, _params.headers),
|
|
836
|
-
}),
|
|
837
|
-
};
|
|
838
|
-
return this.createRequest(parameters);
|
|
839
|
-
};
|
|
840
|
-
/**
|
|
841
|
-
* Get the metadata of a secret.
|
|
842
|
-
*
|
|
843
|
-
* Get the details of a secret by specifying its ID.
|
|
844
|
-
*
|
|
845
|
-
* A successful request returns only metadata about the secret, such as its name and creation date. To retrieve the
|
|
846
|
-
* value of a secret, use the [Get a secret](#get-secret) or [Get a version of a secret](#get-secret-version) methods.
|
|
847
|
-
*
|
|
848
|
-
* @param {Object} params - The parameters to send to the service.
|
|
849
|
-
* @param {string} params.secretType - The secret type.
|
|
850
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
851
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
852
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretMetadataRequest>>}
|
|
853
|
-
*/
|
|
854
|
-
SecretsManagerV1.prototype.getSecretMetadata = function (params) {
|
|
855
|
-
var _params = __assign({}, params);
|
|
856
|
-
var _requiredParams = ['secretType', 'id'];
|
|
857
|
-
var _validParams = ['secretType', 'id', 'headers'];
|
|
858
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
859
|
-
if (_validationErrors) {
|
|
860
|
-
return Promise.reject(_validationErrors);
|
|
861
|
-
}
|
|
862
|
-
var path = {
|
|
863
|
-
'secret_type': _params.secretType,
|
|
864
|
-
'id': _params.id,
|
|
865
|
-
};
|
|
866
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecretMetadata');
|
|
867
|
-
var parameters = {
|
|
868
|
-
options: {
|
|
869
|
-
url: '/api/v1/secrets/{secret_type}/{id}/metadata',
|
|
870
|
-
method: 'GET',
|
|
871
|
-
path: path,
|
|
872
|
-
},
|
|
873
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
874
|
-
headers: extend(true, sdkHeaders, {
|
|
875
|
-
'Accept': 'application/json',
|
|
876
|
-
}, _params.headers),
|
|
877
|
-
}),
|
|
878
|
-
};
|
|
879
|
-
return this.createRequest(parameters);
|
|
880
|
-
};
|
|
881
|
-
/**
|
|
882
|
-
* Update secret metadata.
|
|
883
|
-
*
|
|
884
|
-
* Update the metadata of a secret, such as its name or description.
|
|
885
|
-
*
|
|
886
|
-
* To update the actual contents of a secret, rotate the secret by using the [Invoke an action on a
|
|
887
|
-
* secret](#update-secret) method.
|
|
888
|
-
*
|
|
889
|
-
* @param {Object} params - The parameters to send to the service.
|
|
890
|
-
* @param {string} params.secretType - The secret type.
|
|
891
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
892
|
-
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
893
|
-
* @param {SecretMetadata[]} params.resources - A collection of resources.
|
|
894
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
895
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.SecretMetadataRequest>>}
|
|
896
|
-
*/
|
|
897
|
-
SecretsManagerV1.prototype.updateSecretMetadata = function (params) {
|
|
898
|
-
var _params = __assign({}, params);
|
|
899
|
-
var _requiredParams = ['secretType', 'id', 'metadata', 'resources'];
|
|
900
|
-
var _validParams = ['secretType', 'id', 'metadata', 'resources', 'headers'];
|
|
901
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
902
|
-
if (_validationErrors) {
|
|
903
|
-
return Promise.reject(_validationErrors);
|
|
904
|
-
}
|
|
905
|
-
var body = {
|
|
906
|
-
'metadata': _params.metadata,
|
|
907
|
-
'resources': _params.resources,
|
|
908
|
-
};
|
|
909
|
-
var path = {
|
|
910
|
-
'secret_type': _params.secretType,
|
|
911
|
-
'id': _params.id,
|
|
912
|
-
};
|
|
913
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'updateSecretMetadata');
|
|
914
|
-
var parameters = {
|
|
915
|
-
options: {
|
|
916
|
-
url: '/api/v1/secrets/{secret_type}/{id}/metadata',
|
|
917
|
-
method: 'PUT',
|
|
918
|
-
body: body,
|
|
919
|
-
path: path,
|
|
920
|
-
},
|
|
921
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
922
|
-
headers: extend(true, sdkHeaders, {
|
|
923
|
-
'Accept': 'application/json',
|
|
924
|
-
'Content-Type': 'application/json',
|
|
925
|
-
}, _params.headers),
|
|
926
|
-
}),
|
|
927
|
-
};
|
|
928
|
-
return this.createRequest(parameters);
|
|
929
|
-
};
|
|
930
|
-
/*************************
|
|
931
|
-
* locks
|
|
932
|
-
************************/
|
|
933
|
-
/**
|
|
934
|
-
* List secret locks.
|
|
935
|
-
*
|
|
936
|
-
* List the locks that are associated with a specified secret.
|
|
937
|
-
*
|
|
938
|
-
* @param {Object} params - The parameters to send to the service.
|
|
939
|
-
* @param {string} params.secretType - The secret type.
|
|
940
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
941
|
-
* @param {number} [params.limit] - The number of locks to retrieve. By default, list operations return the first 25
|
|
942
|
-
* items. To retrieve a different set of items, use `limit` with `offset` to page through your available resources.
|
|
943
|
-
*
|
|
944
|
-
* **Usage:** If you have 20 locks associated with your secret, and you want to retrieve only the first 5 locks, use
|
|
945
|
-
* `..?limit=5`.
|
|
946
|
-
* @param {number} [params.offset] - The number of locks to skip. By specifying `offset`, you retrieve a subset of
|
|
947
|
-
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
948
|
-
*
|
|
949
|
-
* **Usage:** If you have 100 locks on your secret, and you want to retrieve locks 26 through 50, use
|
|
950
|
-
* `..?offset=25&limit=25`.
|
|
951
|
-
* @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
|
|
952
|
-
*
|
|
953
|
-
* **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
|
|
954
|
-
* `..?search=text`.
|
|
955
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
956
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretLocks>>}
|
|
957
|
-
*/
|
|
958
|
-
SecretsManagerV1.prototype.getLocks = function (params) {
|
|
959
|
-
var _params = __assign({}, params);
|
|
960
|
-
var _requiredParams = ['secretType', 'id'];
|
|
961
|
-
var _validParams = ['secretType', 'id', 'limit', 'offset', 'search', 'headers'];
|
|
962
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
963
|
-
if (_validationErrors) {
|
|
964
|
-
return Promise.reject(_validationErrors);
|
|
965
|
-
}
|
|
966
|
-
var query = {
|
|
967
|
-
'limit': _params.limit,
|
|
968
|
-
'offset': _params.offset,
|
|
969
|
-
'search': _params.search,
|
|
970
|
-
};
|
|
971
|
-
var path = {
|
|
972
|
-
'secret_type': _params.secretType,
|
|
973
|
-
'id': _params.id,
|
|
974
|
-
};
|
|
975
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getLocks');
|
|
976
|
-
var parameters = {
|
|
977
|
-
options: {
|
|
978
|
-
url: '/api/v1/locks/{secret_type}/{id}',
|
|
979
|
-
method: 'GET',
|
|
980
|
-
qs: query,
|
|
981
|
-
path: path,
|
|
982
|
-
},
|
|
983
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
984
|
-
headers: extend(true, sdkHeaders, {
|
|
985
|
-
'Accept': 'application/json',
|
|
986
|
-
}, _params.headers),
|
|
987
|
-
}),
|
|
988
|
-
};
|
|
989
|
-
return this.createRequest(parameters);
|
|
990
|
-
};
|
|
991
|
-
/**
|
|
992
|
-
* Lock a secret.
|
|
993
|
-
*
|
|
994
|
-
* Create a lock on the current version of a secret.
|
|
995
|
-
*
|
|
996
|
-
* A lock can be used to prevent a secret from being deleted or modified while it's in use by your applications. A
|
|
997
|
-
* successful request attaches a new lock to your secret, or replaces a lock of the same name if it already exists.
|
|
998
|
-
* Additionally, you can use this method to clear any matching locks on a secret by using one of the following
|
|
999
|
-
* optional lock modes:
|
|
1000
|
-
*
|
|
1001
|
-
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
1002
|
-
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
1003
|
-
* it doesn't have any locks.
|
|
1004
|
-
*
|
|
1005
|
-
* For more information about locking secrets, check out the
|
|
1006
|
-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-locks).
|
|
1007
|
-
*
|
|
1008
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1009
|
-
* @param {string} params.secretType - The secret type.
|
|
1010
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1011
|
-
* @param {LockSecretBodyLocksItem[]} [params.locks] - The lock data to be attached to a secret version.
|
|
1012
|
-
* @param {string} [params.mode] - An optional lock mode. At lock creation, you can set one of the following modes to
|
|
1013
|
-
* clear any matching locks on a secret version. Note: When you are locking the `previous` version, the mode parameter
|
|
1014
|
-
* is ignored.
|
|
1015
|
-
*
|
|
1016
|
-
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
1017
|
-
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
1018
|
-
* it doesn't have any locks.
|
|
1019
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1020
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
1021
|
-
*/
|
|
1022
|
-
SecretsManagerV1.prototype.lockSecret = function (params) {
|
|
1023
|
-
var _params = __assign({}, params);
|
|
1024
|
-
var _requiredParams = ['secretType', 'id'];
|
|
1025
|
-
var _validParams = ['secretType', 'id', 'locks', 'mode', 'headers'];
|
|
1026
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1027
|
-
if (_validationErrors) {
|
|
1028
|
-
return Promise.reject(_validationErrors);
|
|
1029
|
-
}
|
|
1030
|
-
var body = {
|
|
1031
|
-
'locks': _params.locks,
|
|
1032
|
-
};
|
|
1033
|
-
var query = {
|
|
1034
|
-
'mode': _params.mode,
|
|
1035
|
-
};
|
|
1036
|
-
var path = {
|
|
1037
|
-
'secret_type': _params.secretType,
|
|
1038
|
-
'id': _params.id,
|
|
1039
|
-
};
|
|
1040
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'lockSecret');
|
|
1041
|
-
var parameters = {
|
|
1042
|
-
options: {
|
|
1043
|
-
url: '/api/v1/locks/{secret_type}/{id}/lock',
|
|
1044
|
-
method: 'POST',
|
|
1045
|
-
body: body,
|
|
1046
|
-
qs: query,
|
|
1047
|
-
path: path,
|
|
1048
|
-
},
|
|
1049
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1050
|
-
headers: extend(true, sdkHeaders, {
|
|
1051
|
-
'Accept': 'application/json',
|
|
1052
|
-
'Content-Type': 'application/json',
|
|
1053
|
-
}, _params.headers),
|
|
1054
|
-
}),
|
|
1055
|
-
};
|
|
1056
|
-
return this.createRequest(parameters);
|
|
1057
|
-
};
|
|
1058
|
-
/**
|
|
1059
|
-
* Unlock a secret.
|
|
1060
|
-
*
|
|
1061
|
-
* Delete one or more locks that are associated with the current version of a secret.
|
|
1062
|
-
*
|
|
1063
|
-
* A successful request deletes the locks that you specify. To remove all locks, you can pass `{"locks": ["*"]}` in in
|
|
1064
|
-
* the request body. Otherwise, specify the names of the locks that you want to delete. For example, `{"locks":
|
|
1065
|
-
* ["lock1", "lock2"]}`.
|
|
1066
|
-
*
|
|
1067
|
-
* **Note:** A secret is considered unlocked and able to be revoked or deleted only after all of its locks are
|
|
1068
|
-
* removed. To understand whether a secret contains locks, check the `locks_total` field that is returned as part of
|
|
1069
|
-
* the metadata of your secret.
|
|
1070
|
-
*
|
|
1071
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1072
|
-
* @param {string} params.secretType - The secret type.
|
|
1073
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1074
|
-
* @param {string[]} [params.locks] - A comma-separated list of locks to delete.
|
|
1075
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1076
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
1077
|
-
*/
|
|
1078
|
-
SecretsManagerV1.prototype.unlockSecret = function (params) {
|
|
1079
|
-
var _params = __assign({}, params);
|
|
1080
|
-
var _requiredParams = ['secretType', 'id'];
|
|
1081
|
-
var _validParams = ['secretType', 'id', 'locks', 'headers'];
|
|
1082
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1083
|
-
if (_validationErrors) {
|
|
1084
|
-
return Promise.reject(_validationErrors);
|
|
1085
|
-
}
|
|
1086
|
-
var body = {
|
|
1087
|
-
'locks': _params.locks,
|
|
1088
|
-
};
|
|
1089
|
-
var path = {
|
|
1090
|
-
'secret_type': _params.secretType,
|
|
1091
|
-
'id': _params.id,
|
|
1092
|
-
};
|
|
1093
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'unlockSecret');
|
|
1094
|
-
var parameters = {
|
|
1095
|
-
options: {
|
|
1096
|
-
url: '/api/v1/locks/{secret_type}/{id}/unlock',
|
|
1097
|
-
method: 'POST',
|
|
1098
|
-
body: body,
|
|
1099
|
-
path: path,
|
|
1100
|
-
},
|
|
1101
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1102
|
-
headers: extend(true, sdkHeaders, {
|
|
1103
|
-
'Accept': 'application/json',
|
|
1104
|
-
'Content-Type': 'application/json',
|
|
1105
|
-
}, _params.headers),
|
|
1106
|
-
}),
|
|
1107
|
-
};
|
|
1108
|
-
return this.createRequest(parameters);
|
|
1109
|
-
};
|
|
1110
|
-
/**
|
|
1111
|
-
* List secret version locks.
|
|
1112
|
-
*
|
|
1113
|
-
* List the locks that are associated with a specified secret version.
|
|
1114
|
-
*
|
|
1115
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1116
|
-
* @param {string} params.secretType - The secret type.
|
|
1117
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1118
|
-
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
1119
|
-
* `previous` to retrieve the previous version.
|
|
1120
|
-
*
|
|
1121
|
-
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
1122
|
-
* the response details.
|
|
1123
|
-
* @param {number} [params.limit] - The number of locks to retrieve. By default, list operations return the first 25
|
|
1124
|
-
* items. To retrieve a different set of items, use `limit` with `offset` to page through your available resources.
|
|
1125
|
-
*
|
|
1126
|
-
* **Usage:** If you have 20 locks associated with your secret, and you want to retrieve only the first 5 locks, use
|
|
1127
|
-
* `..?limit=5`.
|
|
1128
|
-
* @param {number} [params.offset] - The number of locks to skip. By specifying `offset`, you retrieve a subset of
|
|
1129
|
-
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
1130
|
-
*
|
|
1131
|
-
* **Usage:** If you have 100 locks on your secret, and you want to retrieve locks 26 through 50, use
|
|
1132
|
-
* `..?offset=25&limit=25`.
|
|
1133
|
-
* @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
|
|
1134
|
-
*
|
|
1135
|
-
* **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
|
|
1136
|
-
* `..?search=text`.
|
|
1137
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1138
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ListSecretLocks>>}
|
|
1139
|
-
*/
|
|
1140
|
-
SecretsManagerV1.prototype.getSecretVersionLocks = function (params) {
|
|
1141
|
-
var _params = __assign({}, params);
|
|
1142
|
-
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
1143
|
-
var _validParams = ['secretType', 'id', 'versionId', 'limit', 'offset', 'search', 'headers'];
|
|
1144
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1145
|
-
if (_validationErrors) {
|
|
1146
|
-
return Promise.reject(_validationErrors);
|
|
1147
|
-
}
|
|
1148
|
-
var query = {
|
|
1149
|
-
'limit': _params.limit,
|
|
1150
|
-
'offset': _params.offset,
|
|
1151
|
-
'search': _params.search,
|
|
1152
|
-
};
|
|
1153
|
-
var path = {
|
|
1154
|
-
'secret_type': _params.secretType,
|
|
1155
|
-
'id': _params.id,
|
|
1156
|
-
'version_id': _params.versionId,
|
|
1157
|
-
};
|
|
1158
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getSecretVersionLocks');
|
|
1159
|
-
var parameters = {
|
|
1160
|
-
options: {
|
|
1161
|
-
url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}',
|
|
1162
|
-
method: 'GET',
|
|
1163
|
-
qs: query,
|
|
1164
|
-
path: path,
|
|
1165
|
-
},
|
|
1166
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1167
|
-
headers: extend(true, sdkHeaders, {
|
|
1168
|
-
'Accept': 'application/json',
|
|
1169
|
-
}, _params.headers),
|
|
1170
|
-
}),
|
|
1171
|
-
};
|
|
1172
|
-
return this.createRequest(parameters);
|
|
1173
|
-
};
|
|
1174
|
-
/**
|
|
1175
|
-
* Lock a secret version.
|
|
1176
|
-
*
|
|
1177
|
-
* Create a lock on the specified version of a secret.
|
|
1178
|
-
*
|
|
1179
|
-
* A lock can be used to prevent a secret from being deleted or modified while it's in use by your applications. A
|
|
1180
|
-
* successful request attaches a new lock to the specified version, or replaces a lock of the same name if it already
|
|
1181
|
-
* exists. Additionally, you can use this method to clear any matching locks on a secret version by using one of the
|
|
1182
|
-
* following optional lock modes:
|
|
1183
|
-
*
|
|
1184
|
-
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
1185
|
-
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
1186
|
-
* it doesn't have any locks.
|
|
1187
|
-
*
|
|
1188
|
-
* For more information about locking secrets, check out the
|
|
1189
|
-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secret-locks).
|
|
1190
|
-
*
|
|
1191
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1192
|
-
* @param {string} params.secretType - The secret type.
|
|
1193
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1194
|
-
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
1195
|
-
* `previous` to retrieve the previous version.
|
|
1196
|
-
*
|
|
1197
|
-
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
1198
|
-
* the response details.
|
|
1199
|
-
* @param {LockSecretBodyLocksItem[]} [params.locks] - The lock data to be attached to a secret version.
|
|
1200
|
-
* @param {string} [params.mode] - An optional lock mode. At lock creation, you can set one of the following modes to
|
|
1201
|
-
* clear any matching locks on a secret version. Note: When you are locking the `previous` version, the mode parameter
|
|
1202
|
-
* is ignored.
|
|
1203
|
-
*
|
|
1204
|
-
* - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret.
|
|
1205
|
-
* - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if
|
|
1206
|
-
* it doesn't have any locks.
|
|
1207
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1208
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
1209
|
-
*/
|
|
1210
|
-
SecretsManagerV1.prototype.lockSecretVersion = function (params) {
|
|
1211
|
-
var _params = __assign({}, params);
|
|
1212
|
-
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
1213
|
-
var _validParams = ['secretType', 'id', 'versionId', 'locks', 'mode', 'headers'];
|
|
1214
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1215
|
-
if (_validationErrors) {
|
|
1216
|
-
return Promise.reject(_validationErrors);
|
|
1217
|
-
}
|
|
1218
|
-
var body = {
|
|
1219
|
-
'locks': _params.locks,
|
|
1220
|
-
};
|
|
1221
|
-
var query = {
|
|
1222
|
-
'mode': _params.mode,
|
|
1223
|
-
};
|
|
1224
|
-
var path = {
|
|
1225
|
-
'secret_type': _params.secretType,
|
|
1226
|
-
'id': _params.id,
|
|
1227
|
-
'version_id': _params.versionId,
|
|
1228
|
-
};
|
|
1229
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'lockSecretVersion');
|
|
1230
|
-
var parameters = {
|
|
1231
|
-
options: {
|
|
1232
|
-
url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}/lock',
|
|
1233
|
-
method: 'POST',
|
|
1234
|
-
body: body,
|
|
1235
|
-
qs: query,
|
|
1236
|
-
path: path,
|
|
1237
|
-
},
|
|
1238
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1239
|
-
headers: extend(true, sdkHeaders, {
|
|
1240
|
-
'Accept': 'application/json',
|
|
1241
|
-
'Content-Type': 'application/json',
|
|
1242
|
-
}, _params.headers),
|
|
1243
|
-
}),
|
|
1244
|
-
};
|
|
1245
|
-
return this.createRequest(parameters);
|
|
1246
|
-
};
|
|
1247
|
-
/**
|
|
1248
|
-
* Unlock a secret version.
|
|
1249
|
-
*
|
|
1250
|
-
* Delete one or more locks that are associated with the specified secret version.
|
|
1251
|
-
*
|
|
1252
|
-
* A successful request deletes the locks that you specify. To remove all locks, you can pass `{"locks": ["*"]}` in in
|
|
1253
|
-
* the request body. Otherwise, specify the names of the locks that you want to delete. For example, `{"locks":
|
|
1254
|
-
* ["lock-1", "lock-2"]}`.
|
|
1255
|
-
*
|
|
1256
|
-
* **Note:** A secret is considered unlocked and able to be revoked or deleted only after all of its locks are
|
|
1257
|
-
* removed. To understand whether a secret contains locks, check the `locks_total` field that is returned as part of
|
|
1258
|
-
* the metadata of your secret.
|
|
1259
|
-
*
|
|
1260
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1261
|
-
* @param {string} params.secretType - The secret type.
|
|
1262
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1263
|
-
* @param {string} params.versionId - The v4 UUID that uniquely identifies the secret version. You can also use
|
|
1264
|
-
* `previous` to retrieve the previous version.
|
|
1265
|
-
*
|
|
1266
|
-
* **Note:** To find the version ID of a secret, use the [Get secret metadata](#get-secret-metadata) method and check
|
|
1267
|
-
* the response details.
|
|
1268
|
-
* @param {string[]} [params.locks] - A comma-separated list of locks to delete.
|
|
1269
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1270
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretLocks>>}
|
|
1271
|
-
*/
|
|
1272
|
-
SecretsManagerV1.prototype.unlockSecretVersion = function (params) {
|
|
1273
|
-
var _params = __assign({}, params);
|
|
1274
|
-
var _requiredParams = ['secretType', 'id', 'versionId'];
|
|
1275
|
-
var _validParams = ['secretType', 'id', 'versionId', 'locks', 'headers'];
|
|
1276
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1277
|
-
if (_validationErrors) {
|
|
1278
|
-
return Promise.reject(_validationErrors);
|
|
1279
|
-
}
|
|
1280
|
-
var body = {
|
|
1281
|
-
'locks': _params.locks,
|
|
1282
|
-
};
|
|
1283
|
-
var path = {
|
|
1284
|
-
'secret_type': _params.secretType,
|
|
1285
|
-
'id': _params.id,
|
|
1286
|
-
'version_id': _params.versionId,
|
|
1287
|
-
};
|
|
1288
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'unlockSecretVersion');
|
|
1289
|
-
var parameters = {
|
|
1290
|
-
options: {
|
|
1291
|
-
url: '/api/v1/locks/{secret_type}/{id}/versions/{version_id}/unlock',
|
|
1292
|
-
method: 'POST',
|
|
1293
|
-
body: body,
|
|
1294
|
-
path: path,
|
|
1295
|
-
},
|
|
1296
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1297
|
-
headers: extend(true, sdkHeaders, {
|
|
1298
|
-
'Accept': 'application/json',
|
|
1299
|
-
'Content-Type': 'application/json',
|
|
1300
|
-
}, _params.headers),
|
|
1301
|
-
}),
|
|
1302
|
-
};
|
|
1303
|
-
return this.createRequest(parameters);
|
|
1304
|
-
};
|
|
1305
|
-
/**
|
|
1306
|
-
* List all secrets and locks.
|
|
1307
|
-
*
|
|
1308
|
-
* List the lock details that are associated with all secrets in your Secrets Manager instance.
|
|
1309
|
-
*
|
|
1310
|
-
* @param {Object} [params] - The parameters to send to the service.
|
|
1311
|
-
* @param {number} [params.limit] - The number of secrets with associated locks to retrieve. By default, list
|
|
1312
|
-
* operations return the first 25 items. To retrieve a different set of items, use `limit` with `offset` to page
|
|
1313
|
-
* through your available resources.
|
|
1314
|
-
*
|
|
1315
|
-
* **Usage:** If you have 20 secrets in your instance, and you want to retrieve only the first 5, use
|
|
1316
|
-
* `..?limit=5`.
|
|
1317
|
-
* @param {number} [params.offset] - The number of secrets to skip. By specifying `offset`, you retrieve a subset of
|
|
1318
|
-
* items that starts with the `offset` value. Use `offset` with `limit` to page through your available resources.
|
|
1319
|
-
*
|
|
1320
|
-
* **Usage:** If you have 100 secrets in your instance, and you want to retrieve secrets 26 through 50, use
|
|
1321
|
-
* `..?offset=25&limit=25`.
|
|
1322
|
-
* @param {string} [params.search] - Filter locks that contain the specified string in the field "name".
|
|
1323
|
-
*
|
|
1324
|
-
* **Usage:** If you want to list only the locks that contain the string "text" in the field "name", use
|
|
1325
|
-
* `..?search=text`.
|
|
1326
|
-
* @param {string[]} [params.groups] - Filter secrets by groups.
|
|
1327
|
-
*
|
|
1328
|
-
* You can apply multiple filters by using a comma-separated list of secret group IDs. If you need to filter secrets
|
|
1329
|
-
* that are in the default secret group, use the `default` keyword.
|
|
1330
|
-
*
|
|
1331
|
-
* **Usage:** To retrieve a list of secrets that are associated with an existing secret group or the default group,
|
|
1332
|
-
* use `..?groups={secret_group_ID},default`.
|
|
1333
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1334
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetInstanceLocks>>}
|
|
1335
|
-
*/
|
|
1336
|
-
SecretsManagerV1.prototype.listInstanceSecretsLocks = function (params) {
|
|
1337
|
-
var _params = __assign({}, params);
|
|
1338
|
-
var _requiredParams = [];
|
|
1339
|
-
var _validParams = ['limit', 'offset', 'search', 'groups', 'headers'];
|
|
1340
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1341
|
-
if (_validationErrors) {
|
|
1342
|
-
return Promise.reject(_validationErrors);
|
|
1343
|
-
}
|
|
1344
|
-
var query = {
|
|
1345
|
-
'limit': _params.limit,
|
|
1346
|
-
'offset': _params.offset,
|
|
1347
|
-
'search': _params.search,
|
|
1348
|
-
'groups': _params.groups,
|
|
1349
|
-
};
|
|
1350
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'listInstanceSecretsLocks');
|
|
1351
|
-
var parameters = {
|
|
1352
|
-
options: {
|
|
1353
|
-
url: '/api/v1/locks',
|
|
1354
|
-
method: 'GET',
|
|
1355
|
-
qs: query,
|
|
1356
|
-
},
|
|
1357
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1358
|
-
headers: extend(true, sdkHeaders, {
|
|
1359
|
-
'Accept': 'application/json',
|
|
1360
|
-
}, _params.headers),
|
|
1361
|
-
}),
|
|
1362
|
-
};
|
|
1363
|
-
return this.createRequest(parameters);
|
|
1364
|
-
};
|
|
1365
|
-
/*************************
|
|
1366
|
-
* policies
|
|
1367
|
-
************************/
|
|
1368
|
-
/**
|
|
1369
|
-
* Set secret policies.
|
|
1370
|
-
*
|
|
1371
|
-
* Create or update one or more policies, such as an [automatic rotation
|
|
1372
|
-
* policy](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-automatic-rotation), for the specified
|
|
1373
|
-
* secret. To remove a policy, keep the resources block empty.
|
|
1374
|
-
*
|
|
1375
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1376
|
-
* @param {string} params.secretType - The secret type.
|
|
1377
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1378
|
-
* @param {CollectionMetadata} params.metadata - The metadata that describes the resource array.
|
|
1379
|
-
* @param {SecretPolicyRotation[]} params.resources - A collection of resources.
|
|
1380
|
-
* @param {string} [params.policy] - The type of policy that is associated with the specified secret.
|
|
1381
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1382
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretPolicies>>}
|
|
1383
|
-
*/
|
|
1384
|
-
SecretsManagerV1.prototype.putPolicy = function (params) {
|
|
1385
|
-
var _params = __assign({}, params);
|
|
1386
|
-
var _requiredParams = ['secretType', 'id', 'metadata', 'resources'];
|
|
1387
|
-
var _validParams = ['secretType', 'id', 'metadata', 'resources', 'policy', 'headers'];
|
|
1388
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1389
|
-
if (_validationErrors) {
|
|
1390
|
-
return Promise.reject(_validationErrors);
|
|
1391
|
-
}
|
|
1392
|
-
var body = {
|
|
1393
|
-
'metadata': _params.metadata,
|
|
1394
|
-
'resources': _params.resources,
|
|
1395
|
-
};
|
|
1396
|
-
var query = {
|
|
1397
|
-
'policy': _params.policy,
|
|
1398
|
-
};
|
|
1399
|
-
var path = {
|
|
1400
|
-
'secret_type': _params.secretType,
|
|
1401
|
-
'id': _params.id,
|
|
1402
|
-
};
|
|
1403
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'putPolicy');
|
|
1404
|
-
var parameters = {
|
|
1405
|
-
options: {
|
|
1406
|
-
url: '/api/v1/secrets/{secret_type}/{id}/policies',
|
|
1407
|
-
method: 'PUT',
|
|
1408
|
-
body: body,
|
|
1409
|
-
qs: query,
|
|
1410
|
-
path: path,
|
|
1411
|
-
},
|
|
1412
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1413
|
-
headers: extend(true, sdkHeaders, {
|
|
1414
|
-
'Accept': 'application/json',
|
|
1415
|
-
'Content-Type': 'application/json',
|
|
1416
|
-
}, _params.headers),
|
|
1417
|
-
}),
|
|
1418
|
-
};
|
|
1419
|
-
return this.createRequest(parameters);
|
|
1420
|
-
};
|
|
1421
|
-
/**
|
|
1422
|
-
* List secret policies.
|
|
1423
|
-
*
|
|
1424
|
-
* List the rotation policies that are associated with a specified secret.
|
|
1425
|
-
*
|
|
1426
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1427
|
-
* @param {string} params.secretType - The secret type.
|
|
1428
|
-
* @param {string} params.id - The v4 UUID that uniquely identifies the secret.
|
|
1429
|
-
* @param {string} [params.policy] - The type of policy that is associated with the specified secret.
|
|
1430
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1431
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSecretPolicies>>}
|
|
1432
|
-
*/
|
|
1433
|
-
SecretsManagerV1.prototype.getPolicy = function (params) {
|
|
1434
|
-
var _params = __assign({}, params);
|
|
1435
|
-
var _requiredParams = ['secretType', 'id'];
|
|
1436
|
-
var _validParams = ['secretType', 'id', 'policy', 'headers'];
|
|
1437
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1438
|
-
if (_validationErrors) {
|
|
1439
|
-
return Promise.reject(_validationErrors);
|
|
1440
|
-
}
|
|
1441
|
-
var query = {
|
|
1442
|
-
'policy': _params.policy,
|
|
1443
|
-
};
|
|
1444
|
-
var path = {
|
|
1445
|
-
'secret_type': _params.secretType,
|
|
1446
|
-
'id': _params.id,
|
|
1447
|
-
};
|
|
1448
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getPolicy');
|
|
1449
|
-
var parameters = {
|
|
1450
|
-
options: {
|
|
1451
|
-
url: '/api/v1/secrets/{secret_type}/{id}/policies',
|
|
1452
|
-
method: 'GET',
|
|
1453
|
-
qs: query,
|
|
1454
|
-
path: path,
|
|
1455
|
-
},
|
|
1456
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1457
|
-
headers: extend(true, sdkHeaders, {
|
|
1458
|
-
'Accept': 'application/json',
|
|
1459
|
-
}, _params.headers),
|
|
1460
|
-
}),
|
|
1461
|
-
};
|
|
1462
|
-
return this.createRequest(parameters);
|
|
1463
|
-
};
|
|
1464
|
-
/*************************
|
|
1465
|
-
* config
|
|
1466
|
-
************************/
|
|
1467
|
-
/**
|
|
1468
|
-
* Set the configuration of a secret type.
|
|
1469
|
-
*
|
|
1470
|
-
* Set the configuration for the specified secret type.
|
|
1471
|
-
*
|
|
1472
|
-
* Use this method to configure the IAM credentials (`iam_credentials`) engine for your service instance. Looking to
|
|
1473
|
-
* order or generate certificates? To configure the public certificates (`public_cert`) or private certificates
|
|
1474
|
-
* (`private_cert`) engines, use the [Add a configuration](#create_config_element) method.
|
|
1475
|
-
*
|
|
1476
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1477
|
-
* @param {string} params.secretType - The secret type.
|
|
1478
|
-
* @param {EngineConfig} params.engineConfig - Properties to update for a secrets engine.
|
|
1479
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1480
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.EmptyObject>>}
|
|
1481
|
-
*/
|
|
1482
|
-
SecretsManagerV1.prototype.putConfig = function (params) {
|
|
1483
|
-
var _params = __assign({}, params);
|
|
1484
|
-
var _requiredParams = ['secretType', 'engineConfig'];
|
|
1485
|
-
var _validParams = ['secretType', 'engineConfig', 'headers'];
|
|
1486
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1487
|
-
if (_validationErrors) {
|
|
1488
|
-
return Promise.reject(_validationErrors);
|
|
1489
|
-
}
|
|
1490
|
-
var body = _params.engineConfig;
|
|
1491
|
-
var path = {
|
|
1492
|
-
'secret_type': _params.secretType,
|
|
1493
|
-
};
|
|
1494
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'putConfig');
|
|
1495
|
-
var parameters = {
|
|
1496
|
-
options: {
|
|
1497
|
-
url: '/api/v1/config/{secret_type}',
|
|
1498
|
-
method: 'PUT',
|
|
1499
|
-
body: body,
|
|
1500
|
-
path: path,
|
|
1501
|
-
},
|
|
1502
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1503
|
-
headers: extend(true, sdkHeaders, {
|
|
1504
|
-
'Content-Type': 'application/json',
|
|
1505
|
-
}, _params.headers),
|
|
1506
|
-
}),
|
|
1507
|
-
};
|
|
1508
|
-
return this.createRequest(parameters);
|
|
1509
|
-
};
|
|
1510
|
-
/**
|
|
1511
|
-
* Get the configuration of a secret type.
|
|
1512
|
-
*
|
|
1513
|
-
* Get the configuration that is associated with the specified secret type.
|
|
1514
|
-
*
|
|
1515
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1516
|
-
* @param {string} params.secretType - The secret type.
|
|
1517
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1518
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetConfig>>}
|
|
1519
|
-
*/
|
|
1520
|
-
SecretsManagerV1.prototype.getConfig = function (params) {
|
|
1521
|
-
var _params = __assign({}, params);
|
|
1522
|
-
var _requiredParams = ['secretType'];
|
|
1523
|
-
var _validParams = ['secretType', 'headers'];
|
|
1524
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1525
|
-
if (_validationErrors) {
|
|
1526
|
-
return Promise.reject(_validationErrors);
|
|
1527
|
-
}
|
|
1528
|
-
var path = {
|
|
1529
|
-
'secret_type': _params.secretType,
|
|
1530
|
-
};
|
|
1531
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getConfig');
|
|
1532
|
-
var parameters = {
|
|
1533
|
-
options: {
|
|
1534
|
-
url: '/api/v1/config/{secret_type}',
|
|
1535
|
-
method: 'GET',
|
|
1536
|
-
path: path,
|
|
1537
|
-
},
|
|
1538
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1539
|
-
headers: extend(true, sdkHeaders, {
|
|
1540
|
-
'Accept': 'application/json',
|
|
1541
|
-
}, _params.headers),
|
|
1542
|
-
}),
|
|
1543
|
-
};
|
|
1544
|
-
return this.createRequest(parameters);
|
|
1545
|
-
};
|
|
1546
|
-
/**
|
|
1547
|
-
* Add a configuration.
|
|
1548
|
-
*
|
|
1549
|
-
* Add a configuration element to the specified secret type.
|
|
1550
|
-
*
|
|
1551
|
-
* Use this method to define the configurations that are required to enable the public certificates (`public_cert`)
|
|
1552
|
-
* and private certificates (`private_cert`) engines.
|
|
1553
|
-
*
|
|
1554
|
-
* You can add multiple configurations for your instance as follows:
|
|
1555
|
-
*
|
|
1556
|
-
* - Up to 10 public certificate authority configurations
|
|
1557
|
-
* - Up to 10 DNS provider configurations
|
|
1558
|
-
* - Up to 10 private root certificate authority configurations
|
|
1559
|
-
* - Up to 10 private intermediate certificate authority configurations
|
|
1560
|
-
* - Up to 10 certificate templates.
|
|
1561
|
-
*
|
|
1562
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1563
|
-
* @param {string} params.secretType - The secret type.
|
|
1564
|
-
* @param {string} params.configElement - The configuration element to define or manage.
|
|
1565
|
-
* @param {string} params.name - The human-readable name to assign to your configuration.
|
|
1566
|
-
* @param {string} params.type - The type of configuration. Value options differ depending on the `config_element`
|
|
1567
|
-
* property that you want to define.
|
|
1568
|
-
* @param {ConfigElementDefConfig} params.config - The configuration to define for the specified secret type.
|
|
1569
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1570
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSingleConfigElement>>}
|
|
1571
|
-
*/
|
|
1572
|
-
SecretsManagerV1.prototype.createConfigElement = function (params) {
|
|
1573
|
-
var _params = __assign({}, params);
|
|
1574
|
-
var _requiredParams = ['secretType', 'configElement', 'name', 'type', 'config'];
|
|
1575
|
-
var _validParams = ['secretType', 'configElement', 'name', 'type', 'config', 'headers'];
|
|
1576
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1577
|
-
if (_validationErrors) {
|
|
1578
|
-
return Promise.reject(_validationErrors);
|
|
1579
|
-
}
|
|
1580
|
-
var body = {
|
|
1581
|
-
'name': _params.name,
|
|
1582
|
-
'type': _params.type,
|
|
1583
|
-
'config': _params.config,
|
|
1584
|
-
};
|
|
1585
|
-
var path = {
|
|
1586
|
-
'secret_type': _params.secretType,
|
|
1587
|
-
'config_element': _params.configElement,
|
|
1588
|
-
};
|
|
1589
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'createConfigElement');
|
|
1590
|
-
var parameters = {
|
|
1591
|
-
options: {
|
|
1592
|
-
url: '/api/v1/config/{secret_type}/{config_element}',
|
|
1593
|
-
method: 'POST',
|
|
1594
|
-
body: body,
|
|
1595
|
-
path: path,
|
|
1596
|
-
},
|
|
1597
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1598
|
-
headers: extend(true, sdkHeaders, {
|
|
1599
|
-
'Accept': 'application/json',
|
|
1600
|
-
'Content-Type': 'application/json',
|
|
1601
|
-
}, _params.headers),
|
|
1602
|
-
}),
|
|
1603
|
-
};
|
|
1604
|
-
return this.createRequest(parameters);
|
|
1605
|
-
};
|
|
1606
|
-
/**
|
|
1607
|
-
* List configurations.
|
|
1608
|
-
*
|
|
1609
|
-
* List the configuration elements that are associated with a specified secret type.
|
|
1610
|
-
*
|
|
1611
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1612
|
-
* @param {string} params.secretType - The secret type.
|
|
1613
|
-
* @param {string} params.configElement - The configuration element to define or manage.
|
|
1614
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1615
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetConfigElements>>}
|
|
1616
|
-
*/
|
|
1617
|
-
SecretsManagerV1.prototype.getConfigElements = function (params) {
|
|
1618
|
-
var _params = __assign({}, params);
|
|
1619
|
-
var _requiredParams = ['secretType', 'configElement'];
|
|
1620
|
-
var _validParams = ['secretType', 'configElement', 'headers'];
|
|
1621
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1622
|
-
if (_validationErrors) {
|
|
1623
|
-
return Promise.reject(_validationErrors);
|
|
1624
|
-
}
|
|
1625
|
-
var path = {
|
|
1626
|
-
'secret_type': _params.secretType,
|
|
1627
|
-
'config_element': _params.configElement,
|
|
1628
|
-
};
|
|
1629
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getConfigElements');
|
|
1630
|
-
var parameters = {
|
|
1631
|
-
options: {
|
|
1632
|
-
url: '/api/v1/config/{secret_type}/{config_element}',
|
|
1633
|
-
method: 'GET',
|
|
1634
|
-
path: path,
|
|
1635
|
-
},
|
|
1636
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1637
|
-
headers: extend(true, sdkHeaders, {
|
|
1638
|
-
'Accept': 'application/json',
|
|
1639
|
-
}, _params.headers),
|
|
1640
|
-
}),
|
|
1641
|
-
};
|
|
1642
|
-
return this.createRequest(parameters);
|
|
1643
|
-
};
|
|
1644
|
-
/**
|
|
1645
|
-
* Get a configuration.
|
|
1646
|
-
*
|
|
1647
|
-
* Get the details of a specific configuration that is associated with a secret type.
|
|
1648
|
-
*
|
|
1649
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1650
|
-
* @param {string} params.secretType - The secret type.
|
|
1651
|
-
* @param {string} params.configElement - The configuration element to define or manage.
|
|
1652
|
-
* @param {string} params.configName - The name of your configuration.
|
|
1653
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1654
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSingleConfigElement>>}
|
|
1655
|
-
*/
|
|
1656
|
-
SecretsManagerV1.prototype.getConfigElement = function (params) {
|
|
1657
|
-
var _params = __assign({}, params);
|
|
1658
|
-
var _requiredParams = ['secretType', 'configElement', 'configName'];
|
|
1659
|
-
var _validParams = ['secretType', 'configElement', 'configName', 'headers'];
|
|
1660
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1661
|
-
if (_validationErrors) {
|
|
1662
|
-
return Promise.reject(_validationErrors);
|
|
1663
|
-
}
|
|
1664
|
-
var path = {
|
|
1665
|
-
'secret_type': _params.secretType,
|
|
1666
|
-
'config_element': _params.configElement,
|
|
1667
|
-
'config_name': _params.configName,
|
|
1668
|
-
};
|
|
1669
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getConfigElement');
|
|
1670
|
-
var parameters = {
|
|
1671
|
-
options: {
|
|
1672
|
-
url: '/api/v1/config/{secret_type}/{config_element}/{config_name}',
|
|
1673
|
-
method: 'GET',
|
|
1674
|
-
path: path,
|
|
1675
|
-
},
|
|
1676
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1677
|
-
headers: extend(true, sdkHeaders, {
|
|
1678
|
-
'Accept': 'application/json',
|
|
1679
|
-
}, _params.headers),
|
|
1680
|
-
}),
|
|
1681
|
-
};
|
|
1682
|
-
return this.createRequest(parameters);
|
|
1683
|
-
};
|
|
1684
|
-
/**
|
|
1685
|
-
* Update a configuration.
|
|
1686
|
-
*
|
|
1687
|
-
* Update a configuration element that is associated with the specified secret type.
|
|
1688
|
-
*
|
|
1689
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1690
|
-
* @param {string} params.secretType - The secret type.
|
|
1691
|
-
* @param {string} params.configElement - The configuration element to define or manage.
|
|
1692
|
-
* @param {string} params.configName - The name of your configuration.
|
|
1693
|
-
* @param {string} params.type - The type of configuration. Value options differ depending on the `config_element`
|
|
1694
|
-
* property that you want to define.
|
|
1695
|
-
* @param {JsonObject} params.config - Properties that describe a configuration, which depends on type.
|
|
1696
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1697
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetSingleConfigElement>>}
|
|
1698
|
-
*/
|
|
1699
|
-
SecretsManagerV1.prototype.updateConfigElement = function (params) {
|
|
1700
|
-
var _params = __assign({}, params);
|
|
1701
|
-
var _requiredParams = ['secretType', 'configElement', 'configName', 'type', 'config'];
|
|
1702
|
-
var _validParams = ['secretType', 'configElement', 'configName', 'type', 'config', 'headers'];
|
|
1703
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1704
|
-
if (_validationErrors) {
|
|
1705
|
-
return Promise.reject(_validationErrors);
|
|
1706
|
-
}
|
|
1707
|
-
var body = {
|
|
1708
|
-
'type': _params.type,
|
|
1709
|
-
'config': _params.config,
|
|
1710
|
-
};
|
|
1711
|
-
var path = {
|
|
1712
|
-
'secret_type': _params.secretType,
|
|
1713
|
-
'config_element': _params.configElement,
|
|
1714
|
-
'config_name': _params.configName,
|
|
1715
|
-
};
|
|
1716
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'updateConfigElement');
|
|
1717
|
-
var parameters = {
|
|
1718
|
-
options: {
|
|
1719
|
-
url: '/api/v1/config/{secret_type}/{config_element}/{config_name}',
|
|
1720
|
-
method: 'PUT',
|
|
1721
|
-
body: body,
|
|
1722
|
-
path: path,
|
|
1723
|
-
},
|
|
1724
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1725
|
-
headers: extend(true, sdkHeaders, {
|
|
1726
|
-
'Accept': 'application/json',
|
|
1727
|
-
'Content-Type': 'application/json',
|
|
1728
|
-
}, _params.headers),
|
|
1729
|
-
}),
|
|
1730
|
-
};
|
|
1731
|
-
return this.createRequest(parameters);
|
|
1732
|
-
};
|
|
1733
|
-
/**
|
|
1734
|
-
* Invoke an action on a configuration.
|
|
1735
|
-
*
|
|
1736
|
-
* Invoke an action on a specified configuration element. This method supports the following actions:
|
|
1737
|
-
*
|
|
1738
|
-
* - `sign_intermediate`: Sign an intermediate certificate authority.
|
|
1739
|
-
* - `sign_csr`: Sign a certificate signing request.
|
|
1740
|
-
* - `set_signed`: Set a signed intermediate certificate authority.
|
|
1741
|
-
* - `revoke`: Revoke an internally signed intermediate certificate authority certificate.
|
|
1742
|
-
* - `rotate_crl`: Rotate the certificate revocation list (CRL) of an intermediate certificate authority.
|
|
1743
|
-
*
|
|
1744
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1745
|
-
* @param {string} params.secretType - The secret type.
|
|
1746
|
-
* @param {string} params.configElement - The configuration element on which the action is applied.
|
|
1747
|
-
* @param {string} params.configName - The name of the certificate authority.
|
|
1748
|
-
* @param {string} params.action - The action to perform on the specified configuration element.
|
|
1749
|
-
* @param {ConfigAction} [params.config] - Properties that describe an action on a configuration element.
|
|
1750
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1751
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.ConfigElementActionResult>>}
|
|
1752
|
-
*/
|
|
1753
|
-
SecretsManagerV1.prototype.actionOnConfigElement = function (params) {
|
|
1754
|
-
var _params = __assign({}, params);
|
|
1755
|
-
var _requiredParams = ['secretType', 'configElement', 'configName', 'action'];
|
|
1756
|
-
var _validParams = [
|
|
1757
|
-
'secretType',
|
|
1758
|
-
'configElement',
|
|
1759
|
-
'configName',
|
|
1760
|
-
'action',
|
|
1761
|
-
'config',
|
|
1762
|
-
'headers',
|
|
1763
|
-
];
|
|
1764
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1765
|
-
if (_validationErrors) {
|
|
1766
|
-
return Promise.reject(_validationErrors);
|
|
1767
|
-
}
|
|
1768
|
-
var body = {
|
|
1769
|
-
'config': _params.config,
|
|
1770
|
-
};
|
|
1771
|
-
var query = {
|
|
1772
|
-
'action': _params.action,
|
|
1773
|
-
};
|
|
1774
|
-
var path = {
|
|
1775
|
-
'secret_type': _params.secretType,
|
|
1776
|
-
'config_element': _params.configElement,
|
|
1777
|
-
'config_name': _params.configName,
|
|
1778
|
-
};
|
|
1779
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'actionOnConfigElement');
|
|
1780
|
-
var parameters = {
|
|
1781
|
-
options: {
|
|
1782
|
-
url: '/api/v1/config/{secret_type}/{config_element}/{config_name}',
|
|
1783
|
-
method: 'POST',
|
|
1784
|
-
body: body,
|
|
1785
|
-
qs: query,
|
|
1786
|
-
path: path,
|
|
1787
|
-
},
|
|
1788
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1789
|
-
headers: extend(true, sdkHeaders, {
|
|
1790
|
-
'Accept': 'application/json',
|
|
1791
|
-
'Content-Type': 'application/json',
|
|
1792
|
-
}, _params.headers),
|
|
1793
|
-
}),
|
|
1794
|
-
};
|
|
1795
|
-
return this.createRequest(parameters);
|
|
1796
|
-
};
|
|
1797
|
-
/**
|
|
1798
|
-
* Delete a configuration.
|
|
1799
|
-
*
|
|
1800
|
-
* Delete a configuration element from the specified secret type.
|
|
1801
|
-
*
|
|
1802
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1803
|
-
* @param {string} params.secretType - The secret type.
|
|
1804
|
-
* @param {string} params.configElement - The configuration element to define or manage.
|
|
1805
|
-
* @param {string} params.configName - The name of your configuration.
|
|
1806
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1807
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.EmptyObject>>}
|
|
1808
|
-
*/
|
|
1809
|
-
SecretsManagerV1.prototype.deleteConfigElement = function (params) {
|
|
1810
|
-
var _params = __assign({}, params);
|
|
1811
|
-
var _requiredParams = ['secretType', 'configElement', 'configName'];
|
|
1812
|
-
var _validParams = ['secretType', 'configElement', 'configName', 'headers'];
|
|
1813
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1814
|
-
if (_validationErrors) {
|
|
1815
|
-
return Promise.reject(_validationErrors);
|
|
1816
|
-
}
|
|
1817
|
-
var path = {
|
|
1818
|
-
'secret_type': _params.secretType,
|
|
1819
|
-
'config_element': _params.configElement,
|
|
1820
|
-
'config_name': _params.configName,
|
|
1821
|
-
};
|
|
1822
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteConfigElement');
|
|
1823
|
-
var parameters = {
|
|
1824
|
-
options: {
|
|
1825
|
-
url: '/api/v1/config/{secret_type}/{config_element}/{config_name}',
|
|
1826
|
-
method: 'DELETE',
|
|
1827
|
-
path: path,
|
|
1828
|
-
},
|
|
1829
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1830
|
-
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
1831
|
-
}),
|
|
1832
|
-
};
|
|
1833
|
-
return this.createRequest(parameters);
|
|
1834
|
-
};
|
|
1835
|
-
/*************************
|
|
1836
|
-
* notifications
|
|
1837
|
-
************************/
|
|
1838
|
-
/**
|
|
1839
|
-
* Register with Event Notifications.
|
|
1840
|
-
*
|
|
1841
|
-
* Create a registration between a Secrets Manager instance and [Event
|
|
1842
|
-
* Notifications](https://cloud.ibm.com/apidocs/event-notifications).
|
|
1843
|
-
*
|
|
1844
|
-
* A successful request adds Secrets Manager as a source that you can reference from your Event Notifications
|
|
1845
|
-
* instance. For more information about enabling notifications for Secrets Manager, check out the
|
|
1846
|
-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-event-notifications).
|
|
1847
|
-
*
|
|
1848
|
-
* @param {Object} params - The parameters to send to the service.
|
|
1849
|
-
* @param {string} params.eventNotificationsInstanceCrn - The Cloud Resource Name (CRN) of the connected Event
|
|
1850
|
-
* Notifications instance.
|
|
1851
|
-
* @param {string} params.eventNotificationsSourceName - The name that is displayed as a source in your Event
|
|
1852
|
-
* Notifications instance.
|
|
1853
|
-
* @param {string} [params.eventNotificationsSourceDescription] - An optional description for the source in your Event
|
|
1854
|
-
* Notifications instance.
|
|
1855
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1856
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetNotificationsSettings>>}
|
|
1857
|
-
*/
|
|
1858
|
-
SecretsManagerV1.prototype.createNotificationsRegistration = function (params) {
|
|
1859
|
-
var _params = __assign({}, params);
|
|
1860
|
-
var _requiredParams = ['eventNotificationsInstanceCrn', 'eventNotificationsSourceName'];
|
|
1861
|
-
var _validParams = [
|
|
1862
|
-
'eventNotificationsInstanceCrn',
|
|
1863
|
-
'eventNotificationsSourceName',
|
|
1864
|
-
'eventNotificationsSourceDescription',
|
|
1865
|
-
'headers',
|
|
1866
|
-
];
|
|
1867
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1868
|
-
if (_validationErrors) {
|
|
1869
|
-
return Promise.reject(_validationErrors);
|
|
1870
|
-
}
|
|
1871
|
-
var body = {
|
|
1872
|
-
'event_notifications_instance_crn': _params.eventNotificationsInstanceCrn,
|
|
1873
|
-
'event_notifications_source_name': _params.eventNotificationsSourceName,
|
|
1874
|
-
'event_notifications_source_description': _params.eventNotificationsSourceDescription,
|
|
1875
|
-
};
|
|
1876
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'createNotificationsRegistration');
|
|
1877
|
-
var parameters = {
|
|
1878
|
-
options: {
|
|
1879
|
-
url: '/api/v1/notifications/registration',
|
|
1880
|
-
method: 'POST',
|
|
1881
|
-
body: body,
|
|
1882
|
-
},
|
|
1883
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1884
|
-
headers: extend(true, sdkHeaders, {
|
|
1885
|
-
'Accept': 'application/json',
|
|
1886
|
-
'Content-Type': 'application/json',
|
|
1887
|
-
}, _params.headers),
|
|
1888
|
-
}),
|
|
1889
|
-
};
|
|
1890
|
-
return this.createRequest(parameters);
|
|
1891
|
-
};
|
|
1892
|
-
/**
|
|
1893
|
-
* Get Event Notifications registration details.
|
|
1894
|
-
*
|
|
1895
|
-
* Get the details of an existing registration between a Secrets Manager instance and Event Notifications.
|
|
1896
|
-
*
|
|
1897
|
-
* @param {Object} [params] - The parameters to send to the service.
|
|
1898
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1899
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.GetNotificationsSettings>>}
|
|
1900
|
-
*/
|
|
1901
|
-
SecretsManagerV1.prototype.getNotificationsRegistration = function (params) {
|
|
1902
|
-
var _params = __assign({}, params);
|
|
1903
|
-
var _requiredParams = [];
|
|
1904
|
-
var _validParams = ['headers'];
|
|
1905
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1906
|
-
if (_validationErrors) {
|
|
1907
|
-
return Promise.reject(_validationErrors);
|
|
1908
|
-
}
|
|
1909
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'getNotificationsRegistration');
|
|
1910
|
-
var parameters = {
|
|
1911
|
-
options: {
|
|
1912
|
-
url: '/api/v1/notifications/registration',
|
|
1913
|
-
method: 'GET',
|
|
1914
|
-
},
|
|
1915
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1916
|
-
headers: extend(true, sdkHeaders, {
|
|
1917
|
-
'Accept': 'application/json',
|
|
1918
|
-
}, _params.headers),
|
|
1919
|
-
}),
|
|
1920
|
-
};
|
|
1921
|
-
return this.createRequest(parameters);
|
|
1922
|
-
};
|
|
1923
|
-
/**
|
|
1924
|
-
* Unregister from Event Notifications.
|
|
1925
|
-
*
|
|
1926
|
-
* Delete a registration between a Secrets Manager instance and Event Notifications.
|
|
1927
|
-
*
|
|
1928
|
-
* A successful request removes your Secrets Manager instance as a source in Event Notifications.
|
|
1929
|
-
*
|
|
1930
|
-
* @param {Object} [params] - The parameters to send to the service.
|
|
1931
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1932
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.EmptyObject>>}
|
|
1933
|
-
*/
|
|
1934
|
-
SecretsManagerV1.prototype.deleteNotificationsRegistration = function (params) {
|
|
1935
|
-
var _params = __assign({}, params);
|
|
1936
|
-
var _requiredParams = [];
|
|
1937
|
-
var _validParams = ['headers'];
|
|
1938
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1939
|
-
if (_validationErrors) {
|
|
1940
|
-
return Promise.reject(_validationErrors);
|
|
1941
|
-
}
|
|
1942
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'deleteNotificationsRegistration');
|
|
1943
|
-
var parameters = {
|
|
1944
|
-
options: {
|
|
1945
|
-
url: '/api/v1/notifications/registration',
|
|
1946
|
-
method: 'DELETE',
|
|
1947
|
-
},
|
|
1948
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1949
|
-
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
1950
|
-
}),
|
|
1951
|
-
};
|
|
1952
|
-
return this.createRequest(parameters);
|
|
1953
|
-
};
|
|
1954
|
-
/**
|
|
1955
|
-
* Send a test event.
|
|
1956
|
-
*
|
|
1957
|
-
* Send a test event from a Secrets Manager instance to a configured [Event
|
|
1958
|
-
* Notifications](https://cloud.ibm.com/apidocs/event-notifications) instance.
|
|
1959
|
-
*
|
|
1960
|
-
* A successful request sends a test event to the Event Notifications instance. For more information about enabling
|
|
1961
|
-
* notifications for Secrets Manager, check out the
|
|
1962
|
-
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-event-notifications).
|
|
1963
|
-
*
|
|
1964
|
-
* @param {Object} [params] - The parameters to send to the service.
|
|
1965
|
-
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
|
|
1966
|
-
* @returns {Promise<SecretsManagerV1.Response<SecretsManagerV1.EmptyObject>>}
|
|
1967
|
-
*/
|
|
1968
|
-
SecretsManagerV1.prototype.sendTestNotification = function (params) {
|
|
1969
|
-
var _params = __assign({}, params);
|
|
1970
|
-
var _requiredParams = [];
|
|
1971
|
-
var _validParams = ['headers'];
|
|
1972
|
-
var _validationErrors = (0, ibm_cloud_sdk_core_1.validateParams)(_params, _requiredParams, _validParams);
|
|
1973
|
-
if (_validationErrors) {
|
|
1974
|
-
return Promise.reject(_validationErrors);
|
|
1975
|
-
}
|
|
1976
|
-
var sdkHeaders = (0, common_1.getSdkHeaders)(SecretsManagerV1.DEFAULT_SERVICE_NAME, 'v1', 'sendTestNotification');
|
|
1977
|
-
var parameters = {
|
|
1978
|
-
options: {
|
|
1979
|
-
url: '/api/v1/notifications/test',
|
|
1980
|
-
method: 'GET',
|
|
1981
|
-
},
|
|
1982
|
-
defaultOptions: extend(true, {}, this.baseOptions, {
|
|
1983
|
-
headers: extend(true, sdkHeaders, {}, _params.headers),
|
|
1984
|
-
}),
|
|
1985
|
-
};
|
|
1986
|
-
return this.createRequest(parameters);
|
|
1987
|
-
};
|
|
1988
|
-
SecretsManagerV1.DEFAULT_SERVICE_NAME = 'secrets_manager';
|
|
1989
|
-
return SecretsManagerV1;
|
|
1990
|
-
}(ibm_cloud_sdk_core_1.BaseService));
|
|
1991
|
-
/*************************
|
|
1992
|
-
* interfaces
|
|
1993
|
-
************************/
|
|
1994
|
-
(function (SecretsManagerV1) {
|
|
1995
|
-
/** Constants for the `createSecret` operation. */
|
|
1996
|
-
var CreateSecretConstants;
|
|
1997
|
-
(function (CreateSecretConstants) {
|
|
1998
|
-
/** The secret type. */
|
|
1999
|
-
var SecretType;
|
|
2000
|
-
(function (SecretType) {
|
|
2001
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2002
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2003
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2004
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2005
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2006
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2007
|
-
SecretType["KV"] = "kv";
|
|
2008
|
-
})(SecretType = CreateSecretConstants.SecretType || (CreateSecretConstants.SecretType = {}));
|
|
2009
|
-
})(CreateSecretConstants = SecretsManagerV1.CreateSecretConstants || (SecretsManagerV1.CreateSecretConstants = {}));
|
|
2010
|
-
/** Constants for the `listSecrets` operation. */
|
|
2011
|
-
var ListSecretsConstants;
|
|
2012
|
-
(function (ListSecretsConstants) {
|
|
2013
|
-
/** The secret type. */
|
|
2014
|
-
var SecretType;
|
|
2015
|
-
(function (SecretType) {
|
|
2016
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2017
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2018
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2019
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2020
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2021
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2022
|
-
SecretType["KV"] = "kv";
|
|
2023
|
-
})(SecretType = ListSecretsConstants.SecretType || (ListSecretsConstants.SecretType = {}));
|
|
2024
|
-
})(ListSecretsConstants = SecretsManagerV1.ListSecretsConstants || (SecretsManagerV1.ListSecretsConstants = {}));
|
|
2025
|
-
/** Constants for the `listAllSecrets` operation. */
|
|
2026
|
-
var ListAllSecretsConstants;
|
|
2027
|
-
(function (ListAllSecretsConstants) {
|
|
2028
|
-
/** Sort a list of secrets by the specified field. **Usage:** To sort a list of secrets by their creation date, use `../secrets/{secret_type}?sort_by=creation_date`. */
|
|
2029
|
-
var SortBy;
|
|
2030
|
-
(function (SortBy) {
|
|
2031
|
-
SortBy["ID"] = "id";
|
|
2032
|
-
SortBy["CREATION_DATE"] = "creation_date";
|
|
2033
|
-
SortBy["EXPIRATION_DATE"] = "expiration_date";
|
|
2034
|
-
SortBy["SECRET_TYPE"] = "secret_type";
|
|
2035
|
-
SortBy["NAME"] = "name";
|
|
2036
|
-
})(SortBy = ListAllSecretsConstants.SortBy || (ListAllSecretsConstants.SortBy = {}));
|
|
2037
|
-
})(ListAllSecretsConstants = SecretsManagerV1.ListAllSecretsConstants || (SecretsManagerV1.ListAllSecretsConstants = {}));
|
|
2038
|
-
/** Constants for the `getSecret` operation. */
|
|
2039
|
-
var GetSecretConstants;
|
|
2040
|
-
(function (GetSecretConstants) {
|
|
2041
|
-
/** The secret type. */
|
|
2042
|
-
var SecretType;
|
|
2043
|
-
(function (SecretType) {
|
|
2044
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2045
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2046
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2047
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2048
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2049
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2050
|
-
SecretType["KV"] = "kv";
|
|
2051
|
-
})(SecretType = GetSecretConstants.SecretType || (GetSecretConstants.SecretType = {}));
|
|
2052
|
-
})(GetSecretConstants = SecretsManagerV1.GetSecretConstants || (SecretsManagerV1.GetSecretConstants = {}));
|
|
2053
|
-
/** Constants for the `updateSecret` operation. */
|
|
2054
|
-
var UpdateSecretConstants;
|
|
2055
|
-
(function (UpdateSecretConstants) {
|
|
2056
|
-
/** The secret type. */
|
|
2057
|
-
var SecretType;
|
|
2058
|
-
(function (SecretType) {
|
|
2059
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2060
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2061
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2062
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2063
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2064
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2065
|
-
SecretType["KV"] = "kv";
|
|
2066
|
-
})(SecretType = UpdateSecretConstants.SecretType || (UpdateSecretConstants.SecretType = {}));
|
|
2067
|
-
/** The action to perform on the specified secret. */
|
|
2068
|
-
var Action;
|
|
2069
|
-
(function (Action) {
|
|
2070
|
-
Action["ROTATE"] = "rotate";
|
|
2071
|
-
Action["RESTORE"] = "restore";
|
|
2072
|
-
Action["REVOKE"] = "revoke";
|
|
2073
|
-
Action["DELETE_CREDENTIALS"] = "delete_credentials";
|
|
2074
|
-
Action["VALIDATE_DNS_CHALLENGE"] = "validate_dns_challenge";
|
|
2075
|
-
})(Action = UpdateSecretConstants.Action || (UpdateSecretConstants.Action = {}));
|
|
2076
|
-
})(UpdateSecretConstants = SecretsManagerV1.UpdateSecretConstants || (SecretsManagerV1.UpdateSecretConstants = {}));
|
|
2077
|
-
/** Constants for the `deleteSecret` operation. */
|
|
2078
|
-
var DeleteSecretConstants;
|
|
2079
|
-
(function (DeleteSecretConstants) {
|
|
2080
|
-
/** The secret type. */
|
|
2081
|
-
var SecretType;
|
|
2082
|
-
(function (SecretType) {
|
|
2083
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2084
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2085
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2086
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2087
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2088
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2089
|
-
SecretType["KV"] = "kv";
|
|
2090
|
-
})(SecretType = DeleteSecretConstants.SecretType || (DeleteSecretConstants.SecretType = {}));
|
|
2091
|
-
})(DeleteSecretConstants = SecretsManagerV1.DeleteSecretConstants || (SecretsManagerV1.DeleteSecretConstants = {}));
|
|
2092
|
-
/** Constants for the `listSecretVersions` operation. */
|
|
2093
|
-
var ListSecretVersionsConstants;
|
|
2094
|
-
(function (ListSecretVersionsConstants) {
|
|
2095
|
-
/** The secret type. */
|
|
2096
|
-
var SecretType;
|
|
2097
|
-
(function (SecretType) {
|
|
2098
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2099
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2100
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2101
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2102
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2103
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2104
|
-
SecretType["KV"] = "kv";
|
|
2105
|
-
})(SecretType = ListSecretVersionsConstants.SecretType || (ListSecretVersionsConstants.SecretType = {}));
|
|
2106
|
-
})(ListSecretVersionsConstants = SecretsManagerV1.ListSecretVersionsConstants || (SecretsManagerV1.ListSecretVersionsConstants = {}));
|
|
2107
|
-
/** Constants for the `getSecretVersion` operation. */
|
|
2108
|
-
var GetSecretVersionConstants;
|
|
2109
|
-
(function (GetSecretVersionConstants) {
|
|
2110
|
-
/** The secret type. */
|
|
2111
|
-
var SecretType;
|
|
2112
|
-
(function (SecretType) {
|
|
2113
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2114
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2115
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2116
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2117
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2118
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2119
|
-
SecretType["KV"] = "kv";
|
|
2120
|
-
})(SecretType = GetSecretVersionConstants.SecretType || (GetSecretVersionConstants.SecretType = {}));
|
|
2121
|
-
})(GetSecretVersionConstants = SecretsManagerV1.GetSecretVersionConstants || (SecretsManagerV1.GetSecretVersionConstants = {}));
|
|
2122
|
-
/** Constants for the `updateSecretVersion` operation. */
|
|
2123
|
-
var UpdateSecretVersionConstants;
|
|
2124
|
-
(function (UpdateSecretVersionConstants) {
|
|
2125
|
-
/** The secret type. */
|
|
2126
|
-
var SecretType;
|
|
2127
|
-
(function (SecretType) {
|
|
2128
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2129
|
-
})(SecretType = UpdateSecretVersionConstants.SecretType || (UpdateSecretVersionConstants.SecretType = {}));
|
|
2130
|
-
/** The action to perform on the specified secret version. */
|
|
2131
|
-
var Action;
|
|
2132
|
-
(function (Action) {
|
|
2133
|
-
Action["REVOKE"] = "revoke";
|
|
2134
|
-
})(Action = UpdateSecretVersionConstants.Action || (UpdateSecretVersionConstants.Action = {}));
|
|
2135
|
-
})(UpdateSecretVersionConstants = SecretsManagerV1.UpdateSecretVersionConstants || (SecretsManagerV1.UpdateSecretVersionConstants = {}));
|
|
2136
|
-
/** Constants for the `getSecretVersionMetadata` operation. */
|
|
2137
|
-
var GetSecretVersionMetadataConstants;
|
|
2138
|
-
(function (GetSecretVersionMetadataConstants) {
|
|
2139
|
-
/** The secret type. */
|
|
2140
|
-
var SecretType;
|
|
2141
|
-
(function (SecretType) {
|
|
2142
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2143
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2144
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2145
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2146
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2147
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2148
|
-
SecretType["KV"] = "kv";
|
|
2149
|
-
})(SecretType = GetSecretVersionMetadataConstants.SecretType || (GetSecretVersionMetadataConstants.SecretType = {}));
|
|
2150
|
-
})(GetSecretVersionMetadataConstants = SecretsManagerV1.GetSecretVersionMetadataConstants || (SecretsManagerV1.GetSecretVersionMetadataConstants = {}));
|
|
2151
|
-
/** Constants for the `updateSecretVersionMetadata` operation. */
|
|
2152
|
-
var UpdateSecretVersionMetadataConstants;
|
|
2153
|
-
(function (UpdateSecretVersionMetadataConstants) {
|
|
2154
|
-
/** The secret type. */
|
|
2155
|
-
var SecretType;
|
|
2156
|
-
(function (SecretType) {
|
|
2157
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2158
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2159
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2160
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2161
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2162
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2163
|
-
SecretType["KV"] = "kv";
|
|
2164
|
-
})(SecretType = UpdateSecretVersionMetadataConstants.SecretType || (UpdateSecretVersionMetadataConstants.SecretType = {}));
|
|
2165
|
-
})(UpdateSecretVersionMetadataConstants = SecretsManagerV1.UpdateSecretVersionMetadataConstants || (SecretsManagerV1.UpdateSecretVersionMetadataConstants = {}));
|
|
2166
|
-
/** Constants for the `getSecretMetadata` operation. */
|
|
2167
|
-
var GetSecretMetadataConstants;
|
|
2168
|
-
(function (GetSecretMetadataConstants) {
|
|
2169
|
-
/** The secret type. */
|
|
2170
|
-
var SecretType;
|
|
2171
|
-
(function (SecretType) {
|
|
2172
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2173
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2174
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2175
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2176
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2177
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2178
|
-
SecretType["KV"] = "kv";
|
|
2179
|
-
})(SecretType = GetSecretMetadataConstants.SecretType || (GetSecretMetadataConstants.SecretType = {}));
|
|
2180
|
-
})(GetSecretMetadataConstants = SecretsManagerV1.GetSecretMetadataConstants || (SecretsManagerV1.GetSecretMetadataConstants = {}));
|
|
2181
|
-
/** Constants for the `updateSecretMetadata` operation. */
|
|
2182
|
-
var UpdateSecretMetadataConstants;
|
|
2183
|
-
(function (UpdateSecretMetadataConstants) {
|
|
2184
|
-
/** The secret type. */
|
|
2185
|
-
var SecretType;
|
|
2186
|
-
(function (SecretType) {
|
|
2187
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2188
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2189
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2190
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2191
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2192
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2193
|
-
SecretType["KV"] = "kv";
|
|
2194
|
-
})(SecretType = UpdateSecretMetadataConstants.SecretType || (UpdateSecretMetadataConstants.SecretType = {}));
|
|
2195
|
-
})(UpdateSecretMetadataConstants = SecretsManagerV1.UpdateSecretMetadataConstants || (SecretsManagerV1.UpdateSecretMetadataConstants = {}));
|
|
2196
|
-
/** Constants for the `getLocks` operation. */
|
|
2197
|
-
var GetLocksConstants;
|
|
2198
|
-
(function (GetLocksConstants) {
|
|
2199
|
-
/** The secret type. */
|
|
2200
|
-
var SecretType;
|
|
2201
|
-
(function (SecretType) {
|
|
2202
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2203
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2204
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2205
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2206
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2207
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2208
|
-
SecretType["KV"] = "kv";
|
|
2209
|
-
})(SecretType = GetLocksConstants.SecretType || (GetLocksConstants.SecretType = {}));
|
|
2210
|
-
})(GetLocksConstants = SecretsManagerV1.GetLocksConstants || (SecretsManagerV1.GetLocksConstants = {}));
|
|
2211
|
-
/** Constants for the `lockSecret` operation. */
|
|
2212
|
-
var LockSecretConstants;
|
|
2213
|
-
(function (LockSecretConstants) {
|
|
2214
|
-
/** The secret type. */
|
|
2215
|
-
var SecretType;
|
|
2216
|
-
(function (SecretType) {
|
|
2217
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2218
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2219
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2220
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2221
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2222
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2223
|
-
SecretType["KV"] = "kv";
|
|
2224
|
-
})(SecretType = LockSecretConstants.SecretType || (LockSecretConstants.SecretType = {}));
|
|
2225
|
-
/** An optional lock mode. At lock creation, you can set one of the following modes to clear any matching locks on a secret version. Note: When you are locking the `previous` version, the mode parameter is ignored. - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret. - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if it doesn't have any locks. */
|
|
2226
|
-
var Mode;
|
|
2227
|
-
(function (Mode) {
|
|
2228
|
-
Mode["EXCLUSIVE"] = "exclusive";
|
|
2229
|
-
Mode["EXCLUSIVE_DELETE"] = "exclusive_delete";
|
|
2230
|
-
})(Mode = LockSecretConstants.Mode || (LockSecretConstants.Mode = {}));
|
|
2231
|
-
})(LockSecretConstants = SecretsManagerV1.LockSecretConstants || (SecretsManagerV1.LockSecretConstants = {}));
|
|
2232
|
-
/** Constants for the `unlockSecret` operation. */
|
|
2233
|
-
var UnlockSecretConstants;
|
|
2234
|
-
(function (UnlockSecretConstants) {
|
|
2235
|
-
/** The secret type. */
|
|
2236
|
-
var SecretType;
|
|
2237
|
-
(function (SecretType) {
|
|
2238
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2239
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2240
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2241
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2242
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2243
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2244
|
-
SecretType["KV"] = "kv";
|
|
2245
|
-
})(SecretType = UnlockSecretConstants.SecretType || (UnlockSecretConstants.SecretType = {}));
|
|
2246
|
-
})(UnlockSecretConstants = SecretsManagerV1.UnlockSecretConstants || (SecretsManagerV1.UnlockSecretConstants = {}));
|
|
2247
|
-
/** Constants for the `getSecretVersionLocks` operation. */
|
|
2248
|
-
var GetSecretVersionLocksConstants;
|
|
2249
|
-
(function (GetSecretVersionLocksConstants) {
|
|
2250
|
-
/** The secret type. */
|
|
2251
|
-
var SecretType;
|
|
2252
|
-
(function (SecretType) {
|
|
2253
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2254
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2255
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2256
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2257
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2258
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2259
|
-
SecretType["KV"] = "kv";
|
|
2260
|
-
})(SecretType = GetSecretVersionLocksConstants.SecretType || (GetSecretVersionLocksConstants.SecretType = {}));
|
|
2261
|
-
})(GetSecretVersionLocksConstants = SecretsManagerV1.GetSecretVersionLocksConstants || (SecretsManagerV1.GetSecretVersionLocksConstants = {}));
|
|
2262
|
-
/** Constants for the `lockSecretVersion` operation. */
|
|
2263
|
-
var LockSecretVersionConstants;
|
|
2264
|
-
(function (LockSecretVersionConstants) {
|
|
2265
|
-
/** The secret type. */
|
|
2266
|
-
var SecretType;
|
|
2267
|
-
(function (SecretType) {
|
|
2268
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2269
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2270
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2271
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2272
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2273
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2274
|
-
SecretType["KV"] = "kv";
|
|
2275
|
-
})(SecretType = LockSecretVersionConstants.SecretType || (LockSecretVersionConstants.SecretType = {}));
|
|
2276
|
-
/** An optional lock mode. At lock creation, you can set one of the following modes to clear any matching locks on a secret version. Note: When you are locking the `previous` version, the mode parameter is ignored. - `exclusive`: Removes any other locks with matching names if they are found in the previous version of the secret. - `exclusive_delete`: Same as `exclusive`, but also permanently deletes the data of the previous secret version if it doesn't have any locks. */
|
|
2277
|
-
var Mode;
|
|
2278
|
-
(function (Mode) {
|
|
2279
|
-
Mode["EXCLUSIVE"] = "exclusive";
|
|
2280
|
-
Mode["EXCLUSIVE_DELETE"] = "exclusive_delete";
|
|
2281
|
-
})(Mode = LockSecretVersionConstants.Mode || (LockSecretVersionConstants.Mode = {}));
|
|
2282
|
-
})(LockSecretVersionConstants = SecretsManagerV1.LockSecretVersionConstants || (SecretsManagerV1.LockSecretVersionConstants = {}));
|
|
2283
|
-
/** Constants for the `unlockSecretVersion` operation. */
|
|
2284
|
-
var UnlockSecretVersionConstants;
|
|
2285
|
-
(function (UnlockSecretVersionConstants) {
|
|
2286
|
-
/** The secret type. */
|
|
2287
|
-
var SecretType;
|
|
2288
|
-
(function (SecretType) {
|
|
2289
|
-
SecretType["ARBITRARY"] = "arbitrary";
|
|
2290
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2291
|
-
SecretType["IMPORTED_CERT"] = "imported_cert";
|
|
2292
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2293
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2294
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2295
|
-
SecretType["KV"] = "kv";
|
|
2296
|
-
})(SecretType = UnlockSecretVersionConstants.SecretType || (UnlockSecretVersionConstants.SecretType = {}));
|
|
2297
|
-
})(UnlockSecretVersionConstants = SecretsManagerV1.UnlockSecretVersionConstants || (SecretsManagerV1.UnlockSecretVersionConstants = {}));
|
|
2298
|
-
/** Constants for the `putPolicy` operation. */
|
|
2299
|
-
var PutPolicyConstants;
|
|
2300
|
-
(function (PutPolicyConstants) {
|
|
2301
|
-
/** The secret type. */
|
|
2302
|
-
var SecretType;
|
|
2303
|
-
(function (SecretType) {
|
|
2304
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2305
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2306
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2307
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2308
|
-
})(SecretType = PutPolicyConstants.SecretType || (PutPolicyConstants.SecretType = {}));
|
|
2309
|
-
/** The type of policy that is associated with the specified secret. */
|
|
2310
|
-
var Policy;
|
|
2311
|
-
(function (Policy) {
|
|
2312
|
-
Policy["ROTATION"] = "rotation";
|
|
2313
|
-
})(Policy = PutPolicyConstants.Policy || (PutPolicyConstants.Policy = {}));
|
|
2314
|
-
})(PutPolicyConstants = SecretsManagerV1.PutPolicyConstants || (SecretsManagerV1.PutPolicyConstants = {}));
|
|
2315
|
-
/** Constants for the `getPolicy` operation. */
|
|
2316
|
-
var GetPolicyConstants;
|
|
2317
|
-
(function (GetPolicyConstants) {
|
|
2318
|
-
/** The secret type. */
|
|
2319
|
-
var SecretType;
|
|
2320
|
-
(function (SecretType) {
|
|
2321
|
-
SecretType["USERNAME_PASSWORD"] = "username_password";
|
|
2322
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2323
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2324
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2325
|
-
})(SecretType = GetPolicyConstants.SecretType || (GetPolicyConstants.SecretType = {}));
|
|
2326
|
-
/** The type of policy that is associated with the specified secret. */
|
|
2327
|
-
var Policy;
|
|
2328
|
-
(function (Policy) {
|
|
2329
|
-
Policy["ROTATION"] = "rotation";
|
|
2330
|
-
})(Policy = GetPolicyConstants.Policy || (GetPolicyConstants.Policy = {}));
|
|
2331
|
-
})(GetPolicyConstants = SecretsManagerV1.GetPolicyConstants || (SecretsManagerV1.GetPolicyConstants = {}));
|
|
2332
|
-
/** Constants for the `putConfig` operation. */
|
|
2333
|
-
var PutConfigConstants;
|
|
2334
|
-
(function (PutConfigConstants) {
|
|
2335
|
-
/** The secret type. */
|
|
2336
|
-
var SecretType;
|
|
2337
|
-
(function (SecretType) {
|
|
2338
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2339
|
-
})(SecretType = PutConfigConstants.SecretType || (PutConfigConstants.SecretType = {}));
|
|
2340
|
-
})(PutConfigConstants = SecretsManagerV1.PutConfigConstants || (SecretsManagerV1.PutConfigConstants = {}));
|
|
2341
|
-
/** Constants for the `getConfig` operation. */
|
|
2342
|
-
var GetConfigConstants;
|
|
2343
|
-
(function (GetConfigConstants) {
|
|
2344
|
-
/** The secret type. */
|
|
2345
|
-
var SecretType;
|
|
2346
|
-
(function (SecretType) {
|
|
2347
|
-
SecretType["IAM_CREDENTIALS"] = "iam_credentials";
|
|
2348
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2349
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2350
|
-
})(SecretType = GetConfigConstants.SecretType || (GetConfigConstants.SecretType = {}));
|
|
2351
|
-
})(GetConfigConstants = SecretsManagerV1.GetConfigConstants || (SecretsManagerV1.GetConfigConstants = {}));
|
|
2352
|
-
/** Constants for the `createConfigElement` operation. */
|
|
2353
|
-
var CreateConfigElementConstants;
|
|
2354
|
-
(function (CreateConfigElementConstants) {
|
|
2355
|
-
/** The secret type. */
|
|
2356
|
-
var SecretType;
|
|
2357
|
-
(function (SecretType) {
|
|
2358
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2359
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2360
|
-
})(SecretType = CreateConfigElementConstants.SecretType || (CreateConfigElementConstants.SecretType = {}));
|
|
2361
|
-
/** The configuration element to define or manage. */
|
|
2362
|
-
var ConfigElement;
|
|
2363
|
-
(function (ConfigElement) {
|
|
2364
|
-
ConfigElement["CERTIFICATE_AUTHORITIES"] = "certificate_authorities";
|
|
2365
|
-
ConfigElement["DNS_PROVIDERS"] = "dns_providers";
|
|
2366
|
-
ConfigElement["ROOT_CERTIFICATE_AUTHORITIES"] = "root_certificate_authorities";
|
|
2367
|
-
ConfigElement["INTERMEDIATE_CERTIFICATE_AUTHORITIES"] = "intermediate_certificate_authorities";
|
|
2368
|
-
ConfigElement["CERTIFICATE_TEMPLATES"] = "certificate_templates";
|
|
2369
|
-
})(ConfigElement = CreateConfigElementConstants.ConfigElement || (CreateConfigElementConstants.ConfigElement = {}));
|
|
2370
|
-
/** The type of configuration. Value options differ depending on the `config_element` property that you want to define. */
|
|
2371
|
-
var Type;
|
|
2372
|
-
(function (Type) {
|
|
2373
|
-
Type["LETSENCRYPT"] = "letsencrypt";
|
|
2374
|
-
Type["LETSENCRYPT_STAGE"] = "letsencrypt-stage";
|
|
2375
|
-
Type["CIS"] = "cis";
|
|
2376
|
-
Type["CLASSIC_INFRASTRUCTURE"] = "classic_infrastructure";
|
|
2377
|
-
Type["ROOT_CERTIFICATE_AUTHORITY"] = "root_certificate_authority";
|
|
2378
|
-
Type["INTERMEDIATE_CERTIFICATE_AUTHORITY"] = "intermediate_certificate_authority";
|
|
2379
|
-
Type["CERTIFICATE_TEMPLATE"] = "certificate_template";
|
|
2380
|
-
})(Type = CreateConfigElementConstants.Type || (CreateConfigElementConstants.Type = {}));
|
|
2381
|
-
})(CreateConfigElementConstants = SecretsManagerV1.CreateConfigElementConstants || (SecretsManagerV1.CreateConfigElementConstants = {}));
|
|
2382
|
-
/** Constants for the `getConfigElements` operation. */
|
|
2383
|
-
var GetConfigElementsConstants;
|
|
2384
|
-
(function (GetConfigElementsConstants) {
|
|
2385
|
-
/** The secret type. */
|
|
2386
|
-
var SecretType;
|
|
2387
|
-
(function (SecretType) {
|
|
2388
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2389
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2390
|
-
})(SecretType = GetConfigElementsConstants.SecretType || (GetConfigElementsConstants.SecretType = {}));
|
|
2391
|
-
/** The configuration element to define or manage. */
|
|
2392
|
-
var ConfigElement;
|
|
2393
|
-
(function (ConfigElement) {
|
|
2394
|
-
ConfigElement["CERTIFICATE_AUTHORITIES"] = "certificate_authorities";
|
|
2395
|
-
ConfigElement["DNS_PROVIDERS"] = "dns_providers";
|
|
2396
|
-
ConfigElement["ROOT_CERTIFICATE_AUTHORITIES"] = "root_certificate_authorities";
|
|
2397
|
-
ConfigElement["INTERMEDIATE_CERTIFICATE_AUTHORITIES"] = "intermediate_certificate_authorities";
|
|
2398
|
-
ConfigElement["CERTIFICATE_TEMPLATES"] = "certificate_templates";
|
|
2399
|
-
})(ConfigElement = GetConfigElementsConstants.ConfigElement || (GetConfigElementsConstants.ConfigElement = {}));
|
|
2400
|
-
})(GetConfigElementsConstants = SecretsManagerV1.GetConfigElementsConstants || (SecretsManagerV1.GetConfigElementsConstants = {}));
|
|
2401
|
-
/** Constants for the `getConfigElement` operation. */
|
|
2402
|
-
var GetConfigElementConstants;
|
|
2403
|
-
(function (GetConfigElementConstants) {
|
|
2404
|
-
/** The secret type. */
|
|
2405
|
-
var SecretType;
|
|
2406
|
-
(function (SecretType) {
|
|
2407
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2408
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2409
|
-
})(SecretType = GetConfigElementConstants.SecretType || (GetConfigElementConstants.SecretType = {}));
|
|
2410
|
-
/** The configuration element to define or manage. */
|
|
2411
|
-
var ConfigElement;
|
|
2412
|
-
(function (ConfigElement) {
|
|
2413
|
-
ConfigElement["CERTIFICATE_AUTHORITIES"] = "certificate_authorities";
|
|
2414
|
-
ConfigElement["DNS_PROVIDERS"] = "dns_providers";
|
|
2415
|
-
ConfigElement["ROOT_CERTIFICATE_AUTHORITIES"] = "root_certificate_authorities";
|
|
2416
|
-
ConfigElement["INTERMEDIATE_CERTIFICATE_AUTHORITIES"] = "intermediate_certificate_authorities";
|
|
2417
|
-
ConfigElement["CERTIFICATE_TEMPLATES"] = "certificate_templates";
|
|
2418
|
-
})(ConfigElement = GetConfigElementConstants.ConfigElement || (GetConfigElementConstants.ConfigElement = {}));
|
|
2419
|
-
})(GetConfigElementConstants = SecretsManagerV1.GetConfigElementConstants || (SecretsManagerV1.GetConfigElementConstants = {}));
|
|
2420
|
-
/** Constants for the `updateConfigElement` operation. */
|
|
2421
|
-
var UpdateConfigElementConstants;
|
|
2422
|
-
(function (UpdateConfigElementConstants) {
|
|
2423
|
-
/** The secret type. */
|
|
2424
|
-
var SecretType;
|
|
2425
|
-
(function (SecretType) {
|
|
2426
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2427
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2428
|
-
})(SecretType = UpdateConfigElementConstants.SecretType || (UpdateConfigElementConstants.SecretType = {}));
|
|
2429
|
-
/** The configuration element to define or manage. */
|
|
2430
|
-
var ConfigElement;
|
|
2431
|
-
(function (ConfigElement) {
|
|
2432
|
-
ConfigElement["CERTIFICATE_AUTHORITIES"] = "certificate_authorities";
|
|
2433
|
-
ConfigElement["DNS_PROVIDERS"] = "dns_providers";
|
|
2434
|
-
ConfigElement["ROOT_CERTIFICATE_AUTHORITIES"] = "root_certificate_authorities";
|
|
2435
|
-
ConfigElement["INTERMEDIATE_CERTIFICATE_AUTHORITIES"] = "intermediate_certificate_authorities";
|
|
2436
|
-
ConfigElement["CERTIFICATE_TEMPLATES"] = "certificate_templates";
|
|
2437
|
-
})(ConfigElement = UpdateConfigElementConstants.ConfigElement || (UpdateConfigElementConstants.ConfigElement = {}));
|
|
2438
|
-
/** The type of configuration. Value options differ depending on the `config_element` property that you want to define. */
|
|
2439
|
-
var Type;
|
|
2440
|
-
(function (Type) {
|
|
2441
|
-
Type["LETSENCRYPT"] = "letsencrypt";
|
|
2442
|
-
Type["LETSENCRYPT_STAGE"] = "letsencrypt-stage";
|
|
2443
|
-
Type["CIS"] = "cis";
|
|
2444
|
-
Type["CLASSIC_INFRASTRUCTURE"] = "classic_infrastructure";
|
|
2445
|
-
Type["ROOT_CERTIFICATE_AUTHORITY"] = "root_certificate_authority";
|
|
2446
|
-
Type["INTERMEDIATE_CERTIFICATE_AUTHORITY"] = "intermediate_certificate_authority";
|
|
2447
|
-
Type["CERTIFICATE_TEMPLATE"] = "certificate_template";
|
|
2448
|
-
})(Type = UpdateConfigElementConstants.Type || (UpdateConfigElementConstants.Type = {}));
|
|
2449
|
-
})(UpdateConfigElementConstants = SecretsManagerV1.UpdateConfigElementConstants || (SecretsManagerV1.UpdateConfigElementConstants = {}));
|
|
2450
|
-
/** Constants for the `actionOnConfigElement` operation. */
|
|
2451
|
-
var ActionOnConfigElementConstants;
|
|
2452
|
-
(function (ActionOnConfigElementConstants) {
|
|
2453
|
-
/** The secret type. */
|
|
2454
|
-
var SecretType;
|
|
2455
|
-
(function (SecretType) {
|
|
2456
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2457
|
-
})(SecretType = ActionOnConfigElementConstants.SecretType || (ActionOnConfigElementConstants.SecretType = {}));
|
|
2458
|
-
/** The configuration element on which the action is applied. */
|
|
2459
|
-
var ConfigElement;
|
|
2460
|
-
(function (ConfigElement) {
|
|
2461
|
-
ConfigElement["ROOT_CERTIFICATE_AUTHORITIES"] = "root_certificate_authorities";
|
|
2462
|
-
ConfigElement["INTERMEDIATE_CERTIFICATE_AUTHORITIES"] = "intermediate_certificate_authorities";
|
|
2463
|
-
})(ConfigElement = ActionOnConfigElementConstants.ConfigElement || (ActionOnConfigElementConstants.ConfigElement = {}));
|
|
2464
|
-
/** The action to perform on the specified configuration element. */
|
|
2465
|
-
var Action;
|
|
2466
|
-
(function (Action) {
|
|
2467
|
-
Action["SIGN_INTERMEDIATE"] = "sign_intermediate";
|
|
2468
|
-
Action["SIGN_CSR"] = "sign_csr";
|
|
2469
|
-
Action["SET_SIGNED"] = "set_signed";
|
|
2470
|
-
Action["REVOKE"] = "revoke";
|
|
2471
|
-
Action["ROTATE_CRL"] = "rotate_crl";
|
|
2472
|
-
})(Action = ActionOnConfigElementConstants.Action || (ActionOnConfigElementConstants.Action = {}));
|
|
2473
|
-
})(ActionOnConfigElementConstants = SecretsManagerV1.ActionOnConfigElementConstants || (SecretsManagerV1.ActionOnConfigElementConstants = {}));
|
|
2474
|
-
/** Constants for the `deleteConfigElement` operation. */
|
|
2475
|
-
var DeleteConfigElementConstants;
|
|
2476
|
-
(function (DeleteConfigElementConstants) {
|
|
2477
|
-
/** The secret type. */
|
|
2478
|
-
var SecretType;
|
|
2479
|
-
(function (SecretType) {
|
|
2480
|
-
SecretType["PUBLIC_CERT"] = "public_cert";
|
|
2481
|
-
SecretType["PRIVATE_CERT"] = "private_cert";
|
|
2482
|
-
})(SecretType = DeleteConfigElementConstants.SecretType || (DeleteConfigElementConstants.SecretType = {}));
|
|
2483
|
-
/** The configuration element to define or manage. */
|
|
2484
|
-
var ConfigElement;
|
|
2485
|
-
(function (ConfigElement) {
|
|
2486
|
-
ConfigElement["CERTIFICATE_AUTHORITIES"] = "certificate_authorities";
|
|
2487
|
-
ConfigElement["DNS_PROVIDERS"] = "dns_providers";
|
|
2488
|
-
ConfigElement["ROOT_CERTIFICATE_AUTHORITIES"] = "root_certificate_authorities";
|
|
2489
|
-
ConfigElement["INTERMEDIATE_CERTIFICATE_AUTHORITIES"] = "intermediate_certificate_authorities";
|
|
2490
|
-
ConfigElement["CERTIFICATE_TEMPLATES"] = "certificate_templates";
|
|
2491
|
-
})(ConfigElement = DeleteConfigElementConstants.ConfigElement || (DeleteConfigElementConstants.ConfigElement = {}));
|
|
2492
|
-
})(DeleteConfigElementConstants = SecretsManagerV1.DeleteConfigElementConstants || (SecretsManagerV1.DeleteConfigElementConstants = {}));
|
|
2493
|
-
})(SecretsManagerV1 || (SecretsManagerV1 = {}));
|
|
2494
|
-
module.exports = SecretsManagerV1;
|
|
2495
|
-
//# sourceMappingURL=v1.js.map
|