@piiano/vault-client
Version:
Piiano Vault generated typescript client
132 lines • 5.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigVarsClient = void 0;
class ConfigVarsClient {
constructor(httpRequest) {
this.httpRequest = httpRequest;
}
/**
* Clear configuration variables
* Clears all dynamic configuration variables.
*
* :::note
* This API is unavailable in the hosted version of Vault.
* :::
*
* The role performing this operation must have the `CapConfvarWriter` capability.
* See [Access control](/data-security/identity-and-access-management#access-control) for more information about how
* capabilities are used to control access to operations.
* @returns any The request is successful.
* @throws ApiError
*/
clearAllConfVars({ customAudit, additionalHeaders = {}, } = {}) {
return this.httpRequest.request({
method: 'DELETE',
url: '/api/pvlt/1.0/system/confvar',
headers: additionalHeaders,
query: {
'custom_audit': customAudit,
},
errors: {
400: `The request is invalid.`,
401: `Authentication credentials are incorrect or missing.`,
403: `The caller doesn't have the required access rights.`,
404: `The requested resource is not found.`,
405: `The operation is not allowed.`,
409: `A conflict occurs.`,
410: `Access to a resource that is no longer available occurs.`,
500: `An error occurs on the server.`,
503: `The service is unavailable.`,
},
});
}
/**
* Get configuration variable
* Gets a dynamic configuration variable by name.
*
* :::note
* This API is unavailable in the hosted version of Vault.
* :::
*
* The variables that can be obtained are:
*
* - `log_level`
*
* The role that performs this operation must have the `CapConfvarReader` capability.
* See [Access control](/data-security/identity-and-access-management#access-control) for more information about how
* capabilities are used to control access to operations.
* @returns ConfVar The request is successful.
* @throws ApiError
*/
getConfVar({ name, customAudit, additionalHeaders = {}, }) {
return this.httpRequest.request({
method: 'GET',
url: '/api/pvlt/1.0/system/confvar/{name}',
path: {
'name': name,
},
headers: additionalHeaders,
query: {
'custom_audit': customAudit,
},
errors: {
400: `The request is invalid.`,
401: `Authentication credentials are incorrect or missing.`,
403: `The caller doesn't have the required access rights.`,
404: `The requested resource is not found.`,
405: `The operation is not allowed.`,
409: `A conflict occurs.`,
410: `Access to a resource that is no longer available occurs.`,
500: `An error occurs on the server.`,
503: `The service is unavailable.`,
},
});
}
/**
* Set configuration variable
* Sets a dynamic configuration variable by name.
*
* :::note
* This API is unavailable in the hosted version of Vault.
* :::
*
* The variables that can be set are:
*
* - `log_level` which can take the values of `debug`, `info`, `warn`, and `error`.
* - `trace_sql` Indicates whether sql logs are enabled. values are `true` or `false`.
*
* The role that performs this operation must have the `CapConfvarWriter` capability.
* See [Access control](/data-security/identity-and-access-management#access-control) for more information about how
* capabilities are used to control access to operations.
* @returns any The request is successful.
* @throws ApiError
*/
setConfVar({ name, requestBody, customAudit, additionalHeaders = {}, }) {
return this.httpRequest.request({
method: 'POST',
url: '/api/pvlt/1.0/system/confvar/{name}',
path: {
'name': name,
},
headers: additionalHeaders,
query: {
'custom_audit': customAudit,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `The request is invalid.`,
401: `Authentication credentials are incorrect or missing.`,
403: `The caller doesn't have the required access rights.`,
404: `The requested resource is not found.`,
405: `The operation is not allowed.`,
409: `A conflict occurs.`,
410: `Access to a resource that is no longer available occurs.`,
500: `An error occurs on the server.`,
503: `The service is unavailable.`,
},
});
}
}
exports.ConfigVarsClient = ConfigVarsClient;
//# sourceMappingURL=ConfigVarsClient.js.map