🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@ibm-cloud/secrets-manager

Package Overview
Dependencies
Maintainers
24
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ibm-cloud/secrets-manager - npm Package Compare versions

Comparing version

to
2.0.10

2

CHANGELOG.md

@@ -0,1 +1,3 @@

## [2.0.10](https://github.com/IBM/secrets-manager-node-sdk/compare/v2.0.9...v2.0.10) (2025-05-05)
## [2.0.9](https://github.com/IBM/secrets-manager-node-sdk/compare/v2.0.8...v2.0.9) (2025-02-17)

@@ -2,0 +4,0 @@

2061

examples/secrets-manager.v2.test.js

@@ -55,1213 +55,1340 @@ /**

describe('SecretsManagerV2', () => {
// Service instance
let secretsManagerService;
// Service instance
let secretsManagerService;
// Variables to hold link values
let configurationNameForGetConfigurationLink;
let secretGroupIdForGetSecretGroupLink;
let secretIdForCreateSecretVersionLink;
let secretIdForCreateSecretVersionLocksLink;
let secretIdForGetSecretLink;
let secretIdForGetSecretVersionLink;
let secretIdForListSecretLocksLink;
let secretIdForListSecretVersionLocksLink;
let secretNameLink;
let secretVersionIdForCreateSecretVersionLocksLink;
let secretVersionIdForDeleteSecretVersionLocksLink;
let secretVersionIdForGetSecretVersionLink;
let secretVersionIdForGetSecretVersionMetadataLink;
let secretVersionIdForListSecretVersionLocksLink;
let secretVersionIdForUpdateSecretVersionMetadataLink;
// Variables to hold link values
let configurationNameForGetConfigurationLink;
let secretGroupIdForGetSecretGroupLink;
let secretIdForCreateSecretVersionLink;
let secretIdForCreateSecretVersionLocksLink;
let secretIdForGetSecretLink;
let secretIdForGetSecretVersionLink;
let secretIdForListSecretLocksLink;
let secretIdForListSecretVersionLocksLink;
let secretNameLink;
let secretVersionIdForCreateSecretVersionLocksLink;
let secretVersionIdForDeleteSecretVersionLocksLink;
let secretVersionIdForGetSecretVersionLink;
let secretVersionIdForGetSecretVersionMetadataLink;
let secretVersionIdForListSecretVersionLocksLink;
let secretVersionIdForUpdateSecretVersionMetadataLink;
// To access additional configuration values, uncomment this line and extract the values from config
// const config = readExternalSources(SecretsManagerV2.DEFAULT_SERVICE_NAME);
// To access additional configuration values, uncomment this line and extract the values from config
// const config = readExternalSources(SecretsManagerV2.DEFAULT_SERVICE_NAME);
test('Initialize service', async () => {
// begin-common
test('Initialize service', async () => {
// begin-common
secretsManagerService = SecretsManagerV2.newInstance();
secretsManagerService = SecretsManagerV2.newInstance();
// end-common
// end-common
});
test('createSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createSecretGroup() result:');
// begin-create_secret_group
originalLog('createSecretGroup() result:');
// begin-create_secret_group
const params = {
name: 'my-secret-group',
};
const params = {
name: 'my-secret-group',
};
let res;
try {
res = await secretsManagerService.createSecretGroup(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createSecretGroup(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret_group
const responseBody = res.result;
secretGroupIdForGetSecretGroupLink = responseBody.id;
});
// end-create_secret_group
const responseBody = res.result;
secretGroupIdForGetSecretGroupLink = responseBody.id;
test('createSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createSecret() result:');
// begin-create_secret
originalLog('createSecret() result:');
// begin-create_secret
// Request models needed by this operation.
// Request models needed by this operation.
// ArbitrarySecretPrototype
const secretPrototypeModel = {
custom_metadata: { metadata_custom_key: 'metadata_custom_value' },
description: 'Description of my arbitrary secret.',
expiration_date: '2030-10-05T11:49:42Z',
labels: ['dev', 'us-south'],
name: 'example-arbitrary-secret',
secret_group_id: 'default',
secret_type: 'arbitrary',
payload: 'secret-data',
version_custom_metadata: { custom_version_key: 'custom_version_value' },
};
// ArbitrarySecretPrototype
const secretPrototypeModel = {
custom_metadata: {metadata_custom_key: 'metadata_custom_value'},
description: 'Description of my arbitrary secret.',
expiration_date: '2030-10-05T11:49:42Z',
labels: ['dev', 'us-south'],
name: 'example-arbitrary-secret',
secret_group_id: 'default',
secret_type: 'arbitrary',
payload: 'secret-data',
version_custom_metadata: {custom_version_key: 'custom_version_value'},
};
const params = {
secretPrototype: secretPrototypeModel,
};
const params = {
secretPrototype: secretPrototypeModel,
};
let res;
try {
res = await secretsManagerService.createSecret(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createSecret(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret
const responseBody = res.result;
secretIdForGetSecretLink = responseBody.id;
secretIdForGetSecretVersionLink = responseBody.id;
});
// end-create_secret
const responseBody = res.result;
secretIdForGetSecretLink = responseBody.id;
secretIdForGetSecretVersionLink = responseBody.id;
test('updateSecretMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('updateSecretMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('updateSecretMetadata() result:');
// begin-update_secret_metadata
originalLog('updateSecretMetadata() result:');
// begin-update_secret_metadata
// Request models needed by this operation.
// Request models needed by this operation.
// ArbitrarySecretMetadataPatch
const secretMetadataPatchModel = {
name: 'updated-arbitrary-secret-name-example',
description: 'updated Arbitrary Secret description',
labels: ['dev', 'us-south'],
custom_metadata: { metadata_custom_key: 'metadata_custom_value' },
};
// ArbitrarySecretMetadataPatch
const secretMetadataPatchModel = {
name: 'updated-arbitrary-secret-name-example',
description: 'updated Arbitrary Secret description',
labels: ['dev', 'us-south'],
custom_metadata: {metadata_custom_key: 'metadata_custom_value'},
};
const params = {
id: secretIdForGetSecretLink,
secretMetadataPatch: secretMetadataPatchModel,
};
const params = {
id: secretIdForGetSecretLink,
secretMetadataPatch: secretMetadataPatchModel,
};
let res;
try {
res = await secretsManagerService.updateSecretMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.updateSecretMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-update_secret_metadata
const responseBody = res.result;
secretNameLink = responseBody.name;
});
// end-update_secret_metadata
const responseBody = res.result;
secretNameLink = responseBody.name;
test('listSecretVersions request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('listSecretVersions request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listSecretVersions() result:');
// begin-list_secret_versions
originalLog('listSecretVersions() result:');
// begin-list_secret_versions
const params = {
secretId: secretIdForGetSecretLink,
};
const params = {
secretId: secretIdForGetSecretLink,
};
let res;
try {
res = await secretsManagerService.listSecretVersions(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.listSecretVersions(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_secret_versions
const responseBody = res.result;
secretVersionIdForGetSecretVersionLink = responseBody.versions[0].id;
secretIdForCreateSecretVersionLink = responseBody.versions[0].secret_id;
secretVersionIdForGetSecretVersionMetadataLink = responseBody.versions[0].id;
secretVersionIdForUpdateSecretVersionMetadataLink = responseBody.versions[0].id;
secretIdForCreateSecretVersionLocksLink = responseBody.versions[0].secret_id;
secretVersionIdForCreateSecretVersionLocksLink = responseBody.versions[0].id;
secretVersionIdForDeleteSecretVersionLocksLink = responseBody.versions[0].id;
});
// end-list_secret_versions
const responseBody = res.result;
secretVersionIdForGetSecretVersionLink = responseBody.versions[0].id;
secretIdForCreateSecretVersionLink = responseBody.versions[0].secret_id;
secretVersionIdForGetSecretVersionMetadataLink = responseBody.versions[0].id;
secretVersionIdForUpdateSecretVersionMetadataLink = responseBody.versions[0].id;
secretIdForCreateSecretVersionLocksLink = responseBody.versions[0].secret_id;
secretVersionIdForCreateSecretVersionLocksLink = responseBody.versions[0].id;
secretVersionIdForDeleteSecretVersionLocksLink = responseBody.versions[0].id;
test('createSecretLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createSecretLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createSecretLocksBulk() result:');
// begin-create_secret_locks_bulk
originalLog('createSecretLocksBulk() result:');
// begin-create_secret_locks_bulk
// Request models needed by this operation.
// Request models needed by this operation.
// SecretLockPrototype
const secretLockPrototypeModel = {
name: 'lock-example-1',
description: 'lock for consumer 1',
attributes: { key: 'value' },
};
// SecretLockPrototype
const secretLockPrototypeModel = {
name: 'lock-example-1',
description: 'lock for consumer 1',
attributes: {key: 'value'},
};
const params = {
id: secretIdForGetSecretLink,
locks: [secretLockPrototypeModel],
};
const params = {
id: secretIdForGetSecretLink,
locks: [secretLockPrototypeModel],
};
let res;
try {
res = await secretsManagerService.createSecretLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createSecretLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret_locks_bulk
const responseBody = res.result;
secretIdForListSecretLocksLink = responseBody.secret_id;
secretIdForListSecretVersionLocksLink = responseBody.secret_id;
secretVersionIdForListSecretVersionLocksLink = responseBody.versions[0].version_id;
});
// end-create_secret_locks_bulk
const responseBody = res.result;
secretIdForListSecretLocksLink = responseBody.secret_id;
secretIdForListSecretVersionLocksLink = responseBody.secret_id;
secretVersionIdForListSecretVersionLocksLink = responseBody.versions[0].version_id;
test('createConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createConfiguration() result:');
// begin-create_configuration
originalLog('createConfiguration() result:');
// begin-create_configuration
// Request models needed by this operation.
// Request models needed by this operation.
// PublicCertificateConfigurationDNSCloudInternetServicesPrototype
const configurationPrototypeModel = {
config_type: 'public_cert_configuration_dns_cloud_internet_services',
name: 'example-cloud-internet-services-config',
cloud_internet_services_apikey: '5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ',
cloud_internet_services_crn: 'crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::',
};
// PublicCertificateConfigurationDNSCloudInternetServicesPrototype
const configurationPrototypeModel = {
config_type: 'public_cert_configuration_dns_cloud_internet_services',
name: 'example-cloud-internet-services-config',
cloud_internet_services_apikey: '5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ',
cloud_internet_services_crn: 'crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::',
};
const params = {
configurationPrototype: configurationPrototypeModel,
};
const params = {
configurationPrototype: configurationPrototypeModel,
};
let res;
try {
res = await secretsManagerService.createConfiguration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createConfiguration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_configuration
const responseBody = res.result;
configurationNameForGetConfigurationLink = responseBody.name;
});
// end-create_configuration
const responseBody = res.result;
configurationNameForGetConfigurationLink = responseBody.name;
test('listSecretGroups request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('listSecretGroups request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listSecretGroups() result:');
// begin-list_secret_groups
originalLog('listSecretGroups() result:');
// begin-list_secret_groups
let res;
try {
res = await secretsManagerService.listSecretGroups({});
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.listSecretGroups({});
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_secret_groups
});
// end-list_secret_groups
test('getSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getSecretGroup() result:');
// begin-get_secret_group
originalLog('getSecretGroup() result:');
// begin-get_secret_group
const params = {
id: secretGroupIdForGetSecretGroupLink,
};
const params = {
id: secretGroupIdForGetSecretGroupLink,
};
let res;
try {
res = await secretsManagerService.getSecretGroup(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.getSecretGroup(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_secret_group
});
// end-get_secret_group
test('updateSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('updateSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('updateSecretGroup() result:');
// begin-update_secret_group
originalLog('updateSecretGroup() result:');
// begin-update_secret_group
const params = {
id: secretGroupIdForGetSecretGroupLink,
};
const params = {
id: secretGroupIdForGetSecretGroupLink,
};
let res;
try {
res = await secretsManagerService.updateSecretGroup(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.updateSecretGroup(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-update_secret_group
});
// end-update_secret_group
test('listSecrets request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('listSecrets request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listSecrets() result:');
// begin-list_secrets
originalLog('listSecrets() result:');
// begin-list_secrets
const params = {
limit: 10,
sort: 'created_at',
search: 'example',
groups: ['default', 'cac40995-c37a-4dcb-9506-472869077634'],
secretTypes: ['arbitrary', 'kv'],
matchAllLabels: ['dev', 'us-south'],
};
const params = {
limit: 10,
sort: 'created_at',
search: 'example',
groups: ['default', 'cac40995-c37a-4dcb-9506-472869077634'],
secretTypes: ['arbitrary', 'kv'],
matchAllLabels: ['dev', 'us-south'],
};
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretsPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretsPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_secrets
});
// end-list_secrets
test('getSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getSecret() result:');
// begin-get_secret
originalLog('getSecret() result:');
// begin-get_secret
const params = {
id: secretIdForGetSecretLink,
};
const params = {
id: secretIdForGetSecretLink,
};
let res;
try {
res = await secretsManagerService.getSecret(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.getSecret(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_secret
});
// end-get_secret
test('getSecretMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getSecretMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getSecretMetadata() result:');
// begin-get_secret_metadata
originalLog('getSecretMetadata() result:');
// begin-get_secret_metadata
const params = {
id: secretIdForGetSecretLink,
};
const params = {
id: secretIdForGetSecretLink,
};
let res;
try {
res = await secretsManagerService.getSecretMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.getSecretMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_secret_metadata
});
// end-get_secret_metadata
test('createSecretAction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createSecretAction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createSecretAction() result:');
// begin-create_secret_action
originalLog('createSecretAction() result:');
// begin-create_secret_action
// Request models needed by this operation.
// Request models needed by this operation.
// PrivateCertificateActionRevokePrototype
const secretActionPrototypeModel = {
action_type: 'private_cert_action_revoke_certificate',
};
// PrivateCertificateActionRevokePrototype
const secretActionPrototypeModel = {
action_type: 'private_cert_action_revoke_certificate',
};
const params = {
id: secretIdForGetSecretLink,
secretActionPrototype: secretActionPrototypeModel,
};
const params = {
id: secretIdForGetSecretLink,
secretActionPrototype: secretActionPrototypeModel,
};
let res;
try {
res = await secretsManagerService.createSecretAction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createSecretAction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret_action
});
// end-create_secret_action
test('getSecretByNameType request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getSecretByNameType request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getSecretByNameType() result:');
// begin-get_secret_by_name_type
originalLog('getSecretByNameType() result:');
// begin-get_secret_by_name_type
const params = {
secretType: 'arbitrary',
name: secretNameLink,
secretGroupName: 'default',
};
const params = {
secretType: 'arbitrary',
name: secretNameLink,
secretGroupName: 'default',
};
let res;
try {
res = await secretsManagerService.getSecretByNameType(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.getSecretByNameType(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_secret_by_name_type
});
// end-get_secret_by_name_type
test('createSecretVersion request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createSecretVersion request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createSecretVersion() result:');
// begin-create_secret_version
originalLog('createSecretVersion() result:');
// begin-create_secret_version
// Request models needed by this operation.
// Request models needed by this operation.
// ArbitrarySecretVersionPrototype
const secretVersionPrototypeModel = {
payload: 'updated secret credentials',
custom_metadata: { metadata_custom_key: 'metadata_custom_value' },
version_custom_metadata: { custom_version_key: 'custom_version_value' },
};
// ArbitrarySecretVersionPrototype
const secretVersionPrototypeModel = {
payload: 'updated secret credentials',
custom_metadata: {metadata_custom_key: 'metadata_custom_value'},
version_custom_metadata: {custom_version_key: 'custom_version_value'},
};
const params = {
secretId: secretIdForGetSecretLink,
secretVersionPrototype: secretVersionPrototypeModel,
};
const params = {
secretId: secretIdForGetSecretLink,
secretVersionPrototype: secretVersionPrototypeModel,
};
let res;
try {
res = await secretsManagerService.createSecretVersion(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createSecretVersion(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret_version
});
// end-create_secret_version
test('getSecretVersion request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getSecretVersion request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getSecretVersion() result:');
// begin-get_secret_version
originalLog('getSecretVersion() result:');
// begin-get_secret_version
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
let res;
try {
res = await secretsManagerService.getSecretVersion(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.getSecretVersion(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_secret_version
});
// end-get_secret_version
test('getSecretVersionMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getSecretVersionMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getSecretVersionMetadata() result:');
// begin-get_secret_version_metadata
originalLog('getSecretVersionMetadata() result:');
// begin-get_secret_version_metadata
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
let res;
try {
res = await secretsManagerService.getSecretVersionMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.getSecretVersionMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_secret_version_metadata
});
// end-get_secret_version_metadata
test('updateSecretVersionMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('updateSecretVersionMetadata request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('updateSecretVersionMetadata() result:');
// begin-update_secret_version_metadata
originalLog('updateSecretVersionMetadata() result:');
// begin-update_secret_version_metadata
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
let res;
try {
res = await secretsManagerService.updateSecretVersionMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.updateSecretVersionMetadata(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-update_secret_version_metadata
});
// end-update_secret_version_metadata
test('createSecretVersionAction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createSecretVersionAction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createSecretVersionAction() result:');
// begin-create_secret_version_action
originalLog('createSecretVersionAction() result:');
// begin-create_secret_version_action
// Request models needed by this operation.
// Request models needed by this operation.
// PrivateCertificateVersionActionRevokePrototype
const secretVersionActionPrototypeModel = {
action_type: 'private_cert_action_revoke_certificate',
};
// PrivateCertificateVersionActionRevokePrototype
const secretVersionActionPrototypeModel = {
action_type: 'private_cert_action_revoke_certificate',
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
secretVersionActionPrototype: secretVersionActionPrototypeModel,
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
secretVersionActionPrototype: secretVersionActionPrototypeModel,
};
let res;
try {
res = await secretsManagerService.createSecretVersionAction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createSecretVersionAction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret_version_action
});
// end-create_secret_version_action
test('listSecretTasks request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('listSecretsLocks request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listSecretTasks() result:');
// begin-list_secret_tasks
originalLog('listSecretsLocks() result:');
// begin-list_secrets_locks
const params = {
secretId: secretIdForGetSecretLink,
};
const params = {
limit: 10,
search: 'example',
groups: ['default', 'cac40995-c37a-4dcb-9506-472869077634'],
};
let res;
try {
res = await secretsManagerService.listSecretTasks(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretsLocksPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_secret_tasks
});
// end-list_secrets_locks
test('getSecretTask request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('listSecretLocks request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getSecretTask() result:');
// begin-get_secret_task
originalLog('listSecretLocks() result:');
// begin-list_secret_locks
const params = {
secretId: secretIdForGetSecretLink,
id: secretIdForGetSecretLink,
};
const params = {
id: secretIdForGetSecretLink,
limit: 10,
sort: 'name',
search: 'example',
};
let res;
try {
res = await secretsManagerService.getSecretTask(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretLocksPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_secret_task
});
// end-list_secret_locks
test('replaceSecretTask request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createSecretVersionLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('replaceSecretTask() result:');
// begin-replace_secret_task
originalLog('createSecretVersionLocksBulk() result:');
// begin-create_secret_version_locks_bulk
// Request models needed by this operation.
// Request models needed by this operation.
// CustomCredentialsNewCredentials
const customCredentialsNewCredentialsModel = {
id: 'b49ad24d-81d4-5ebc-b9b9-b0937d1c84d5',
payload: { token: 'xF9v7OztItL5DOnFgHfS9NCT1sLTUew8KYZcZfxI' },
};
// SecretLockPrototype
const secretLockPrototypeModel = {
name: 'lock-example-1',
description: 'lock for consumer 1',
attributes: {key: 'value'},
};
// SecretTaskPrototypeUpdateSecretTaskCredentialsCreated
const secretTaskPrototypeModel = {
status: 'credentials_created',
credentials: customCredentialsNewCredentialsModel,
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
locks: [secretLockPrototypeModel],
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretIdForGetSecretLink,
taskPut: secretTaskPrototypeModel,
};
let res;
try {
res = await secretsManagerService.createSecretVersionLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.replaceSecretTask(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret_version_locks_bulk
// end-replace_secret_task
});
test('listSecretsLocks request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('listSecretVersionLocks request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listSecretsLocks() result:');
// begin-list_secrets_locks
originalLog('listSecretVersionLocks() result:');
// begin-list_secret_version_locks
const params = {
limit: 10,
search: 'example',
groups: ['default', 'cac40995-c37a-4dcb-9506-472869077634'],
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
limit: 10,
sort: 'name',
search: 'example',
};
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretsLocksPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretVersionLocksPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_secrets_locks
});
// end-list_secret_version_locks
test('listSecretLocks request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('listConfigurations request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listSecretLocks() result:');
// begin-list_secret_locks
originalLog('listConfigurations() result:');
// begin-list_configurations
const params = {
id: secretIdForGetSecretLink,
limit: 10,
sort: 'name',
search: 'example',
};
const params = {
limit: 10,
sort: 'config_type',
search: 'example',
secretTypes: ['iam_credentials', 'public_cert', 'private_cert'],
};
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretLocksPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
const allResults = [];
try {
const pager = new SecretsManagerV2.ConfigurationsPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_secret_locks
});
// end-list_configurations
test('createSecretVersionLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createSecretVersionLocksBulk() result:');
// begin-create_secret_version_locks_bulk
originalLog('getConfiguration() result:');
// begin-get_configuration
// Request models needed by this operation.
const params = {
name: configurationNameForGetConfigurationLink,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
// SecretLockPrototype
const secretLockPrototypeModel = {
name: 'lock-example-1',
description: 'lock for consumer 1',
attributes: { key: 'value' },
};
let res;
try {
res = await secretsManagerService.getConfiguration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
locks: [secretLockPrototypeModel],
};
// end-get_configuration
let res;
try {
res = await secretsManagerService.createSecretVersionLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_secret_version_locks_bulk
});
test('listSecretVersionLocks request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('updateConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('listSecretVersionLocks() result:');
// begin-list_secret_version_locks
originalLog('updateConfiguration() result:');
// begin-update_configuration
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
limit: 10,
sort: 'name',
search: 'example',
};
// Request models needed by this operation.
const allResults = [];
try {
const pager = new SecretsManagerV2.SecretVersionLocksPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// PublicCertificateConfigurationDNSCloudInternetServicesPatch
const configurationPatchModel = {
cloud_internet_services_apikey: '5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ',
cloud_internet_services_crn: 'crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::',
};
// end-list_secret_version_locks
});
const params = {
name: configurationNameForGetConfigurationLink,
configurationPatch: configurationPatchModel,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
test('listConfigurations request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
let res;
try {
res = await secretsManagerService.updateConfiguration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
originalLog('listConfigurations() result:');
// begin-list_configurations
// end-update_configuration
const params = {
limit: 10,
sort: 'config_type',
search: 'example',
secretTypes: ['iam_credentials', 'public_cert', 'private_cert', 'custom_credentials'],
};
const allResults = [];
try {
const pager = new SecretsManagerV2.ConfigurationsPager(secretsManagerService, params);
while (pager.hasNext()) {
const nextPage = await pager.getNext();
expect(nextPage).not.toBeNull();
allResults.push(...nextPage);
}
console.log(JSON.stringify(allResults, null, 2));
} catch (err) {
console.warn(err);
}
// end-list_configurations
});
test('getConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createConfigurationAction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getConfiguration() result:');
// begin-get_configuration
originalLog('createConfigurationAction() result:');
// begin-create_configuration_action
const params = {
name: configurationNameForGetConfigurationLink,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
// Request models needed by this operation.
let res;
try {
res = await secretsManagerService.getConfiguration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// PrivateCertificateConfigurationActionRotateCRLPrototype
const configurationActionPrototypeModel = {
action_type: 'private_cert_configuration_action_rotate_crl',
};
// end-get_configuration
});
const params = {
name: configurationNameForGetConfigurationLink,
configActionPrototype: configurationActionPrototypeModel,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
test('updateConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
let res;
try {
res = await secretsManagerService.createConfigurationAction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
originalLog('updateConfiguration() result:');
// begin-update_configuration
// end-create_configuration_action
// Request models needed by this operation.
// PublicCertificateConfigurationDNSCloudInternetServicesPatch
const configurationPatchModel = {
cloud_internet_services_apikey: '5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ',
cloud_internet_services_crn: 'crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::',
};
const params = {
name: configurationNameForGetConfigurationLink,
configurationPatch: configurationPatchModel,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
let res;
try {
res = await secretsManagerService.updateConfiguration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-update_configuration
});
test('createConfigurationAction request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('createNotificationsRegistration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createConfigurationAction() result:');
// begin-create_configuration_action
originalLog('createNotificationsRegistration() result:');
// begin-create_notifications_registration
// Request models needed by this operation.
const params = {
eventNotificationsInstanceCrn: 'crn:v1:bluemix:public:event-notifications:us-south:a/22018f3c34ff4ff193698d15ca316946:578ad1a4-2fd8-4e66-95d5-79a842ba91f8::',
eventNotificationsSourceName: 'My Secrets Manager',
eventNotificationsSourceDescription: 'Optional description of this source in an Event Notifications instance.',
};
// PrivateCertificateConfigurationActionRotateCRLPrototype
const configurationActionPrototypeModel = {
action_type: 'private_cert_configuration_action_rotate_crl',
};
let res;
try {
res = await secretsManagerService.createNotificationsRegistration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
const params = {
name: configurationNameForGetConfigurationLink,
configActionPrototype: configurationActionPrototypeModel,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
// end-create_notifications_registration
let res;
try {
res = await secretsManagerService.createConfigurationAction(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_configuration_action
});
test('createNotificationsRegistration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getNotificationsRegistration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('createNotificationsRegistration() result:');
// begin-create_notifications_registration
originalLog('getNotificationsRegistration() result:');
// begin-get_notifications_registration
const params = {
eventNotificationsInstanceCrn: 'crn:v1:bluemix:public:event-notifications:us-south:a/22018f3c34ff4ff193698d15ca316946:578ad1a4-2fd8-4e66-95d5-79a842ba91f8::',
eventNotificationsSourceName: 'My Secrets Manager',
eventNotificationsSourceDescription: 'Optional description of this source in an Event Notifications instance.',
};
let res;
try {
res = await secretsManagerService.getNotificationsRegistration({});
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.createNotificationsRegistration(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_notifications_registration
// end-create_notifications_registration
});
test('getNotificationsRegistration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('getNotificationsRegistrationTest request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('getNotificationsRegistration() result:');
// begin-get_notifications_registration
// begin-get_notifications_registration_test
let res;
try {
res = await secretsManagerService.getNotificationsRegistration({});
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
try {
await secretsManagerService.getNotificationsRegistrationTest({});
} catch (err) {
console.warn(err);
}
// end-get_notifications_registration
});
// end-get_notifications_registration_test
test('getNotificationsRegistrationTest request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('deleteSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// begin-get_notifications_registration_test
// begin-delete_secret_group
try {
await secretsManagerService.getNotificationsRegistrationTest({});
} catch (err) {
console.warn(err);
}
const params = {
id: secretGroupIdForGetSecretGroupLink,
};
// end-get_notifications_registration_test
});
try {
await secretsManagerService.deleteSecretGroup(params);
} catch (err) {
console.warn(err);
}
test('deleteSecretGroup request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// end-delete_secret_group
// begin-delete_secret_group
const params = {
id: secretGroupIdForGetSecretGroupLink,
};
try {
await secretsManagerService.deleteSecretGroup(params);
} catch (err) {
console.warn(err);
}
// end-delete_secret_group
});
test('deleteSecretVersionData request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('deleteSecretVersionData request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// begin-delete_secret_version_data
// begin-delete_secret_version_data
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
};
try {
await secretsManagerService.deleteSecretVersionData(params);
} catch (err) {
console.warn(err);
}
try {
await secretsManagerService.deleteSecretVersionData(params);
} catch (err) {
console.warn(err);
}
// end-delete_secret_version_data
});
// end-delete_secret_version_data
test('deleteSecretLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('deleteSecretLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('deleteSecretLocksBulk() result:');
// begin-delete_secret_locks_bulk
originalLog('deleteSecretLocksBulk() result:');
// begin-delete_secret_locks_bulk
const params = {
id: secretIdForGetSecretLink,
name: ['lock-example-1'],
};
const params = {
id: secretIdForGetSecretLink,
name: ['lock-example-1'],
};
let res;
try {
res = await secretsManagerService.deleteSecretLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.deleteSecretLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-delete_secret_locks_bulk
});
// end-delete_secret_locks_bulk
test('deleteSecretVersionLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('deleteSecretVersionLocksBulk request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
originalLog('deleteSecretVersionLocksBulk() result:');
// begin-delete_secret_version_locks_bulk
originalLog('deleteSecretVersionLocksBulk() result:');
// begin-delete_secret_version_locks_bulk
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
name: ['lock-example-1'],
};
const params = {
secretId: secretIdForGetSecretLink,
id: secretVersionIdForGetSecretVersionLink,
name: ['lock-example-1'],
};
let res;
try {
res = await secretsManagerService.deleteSecretVersionLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
let res;
try {
res = await secretsManagerService.deleteSecretVersionLocksBulk(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-delete_secret_version_locks_bulk
});
// end-delete_secret_version_locks_bulk
test('deleteSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('deleteSecret request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// begin-delete_secret
// begin-delete_secret
const params = {
id: secretIdForGetSecretLink,
};
const params = {
id: secretIdForGetSecretLink,
};
try {
await secretsManagerService.deleteSecret(params);
} catch (err) {
console.warn(err);
}
try {
await secretsManagerService.deleteSecret(params);
} catch (err) {
console.warn(err);
}
// end-delete_secret
});
// end-delete_secret
test('deleteSecretTask request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('deleteConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// begin-delete_secret_task
// begin-delete_configuration
const params = {
secretId: secretIdForGetSecretLink,
id: secretIdForGetSecretLink,
};
const params = {
name: configurationNameForGetConfigurationLink,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
try {
await secretsManagerService.deleteSecretTask(params);
} catch (err) {
console.warn(err);
}
try {
await secretsManagerService.deleteConfiguration(params);
} catch (err) {
console.warn(err);
}
// end-delete_secret_task
});
// end-delete_configuration
test('deleteConfiguration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
test('deleteNotificationsRegistration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// begin-delete_configuration
// begin-delete_notifications_registration
const params = {
name: configurationNameForGetConfigurationLink,
xSmAcceptConfigurationType: 'public_cert_configuration_dns_cloud_internet_services',
};
try {
await secretsManagerService.deleteNotificationsRegistration({});
} catch (err) {
console.warn(err);
}
try {
await secretsManagerService.deleteConfiguration(params);
} catch (err) {
console.warn(err);
}
// end-delete_notifications_registration
// end-delete_configuration
});
test('deleteNotificationsRegistration request example', async () => {
consoleLogMock.mockImplementation((output) => {
originalLog(output);
});
consoleWarnMock.mockImplementation((output) => {
// if an error occurs, display the message and then fail the test
originalWarn(output);
expect(true).toBeFalsy();
});
// begin-delete_notifications_registration
try {
await secretsManagerService.deleteNotificationsRegistration({});
} catch (err) {
console.warn(err);
}
// end-delete_notifications_registration
});
});
{
"name": "@ibm-cloud/secrets-manager",
"version": "2.0.9",
"version": "2.0.10",
"description": "Client library for IBM Cloud Secrets Manager",

@@ -39,3 +39,3 @@ "repository": {

"extend": "^3.0.2",
"ibm-cloud-sdk-core": "^5.1.2"
"ibm-cloud-sdk-core": "^5.3.2"
},

@@ -42,0 +42,0 @@ "jest": {

@@ -53,4 +53,3 @@ ![tests](https://github.com/IBM/secrets-manager-node-sdk/workflows/run-tests/badge.svg)

Authentication for this SDK is accomplished by
using [IAM authenticators](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md#authentication). Import
Authentication for this SDK is accomplished by using [IAM authenticators](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md#authentication). Import
authenticators from `@ibm-cloud/secrets-manager/auth`.

@@ -57,0 +56,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet