@canonical/jujulib
Version:
Juju API client
305 lines (302 loc) • 8.74 kB
TypeScript
/**
Juju SecretsManager version 2.
This facade is available on:
Controller-machine-agent
Machine-agent
Unit-agent
Models
NOTE: This file was generated using the Juju schema
from Juju 3.3 at the git SHA 65fa4c1ee5.
Do not manually edit this file.
*/
import { ConnectionInfo, Transport } from "../../client.js";
import { Facade } from "../../types.js";
export interface AccessInfo {
role: string;
"scope-tag": string;
"target-tag": string;
}
export interface CreateSecretArg {
UpsertSecretArg: UpsertSecretArg;
content?: SecretContentParams;
description?: string;
"expire-time"?: string;
label?: string;
"owner-tag": string;
params?: AdditionalProperties;
"rotate-policy"?: string;
uri?: string;
}
export interface CreateSecretArgs {
args: CreateSecretArg[];
}
export interface CreateSecretURIsArg {
count: number;
}
export interface DeleteSecretArg {
label: string;
revisions?: number[];
uri: string;
}
export interface DeleteSecretArgs {
args: DeleteSecretArg[];
}
export interface Entities {
entities: Entity[];
}
export interface Entity {
tag: string;
}
export interface Error {
code: string;
info?: AdditionalProperties;
message: string;
}
export interface ErrorResult {
error?: Error;
}
export interface ErrorResults {
results: ErrorResult[];
}
export interface GetSecretConsumerInfoArgs {
"consumer-tag": string;
uris: string[];
}
export interface GetSecretContentArg {
label?: string;
peek?: boolean;
refresh?: boolean;
uri: string;
}
export interface GetSecretContentArgs {
args: GetSecretContentArg[];
}
export interface GrantRevokeSecretArg {
role: string;
"scope-tag": string;
"subject-tags": string[];
uri: string;
}
export interface GrantRevokeSecretArgs {
args: GrantRevokeSecretArg[];
}
export interface ListSecretResult {
access?: AccessInfo[];
"create-time": string;
description?: string;
label?: string;
"latest-expire-time"?: string;
"latest-revision": number;
"next-rotate-time"?: string;
"owner-tag": string;
revisions: SecretRevision[];
"rotate-policy"?: string;
"update-time": string;
uri: string;
value?: SecretValueResult;
version: number;
}
export interface ListSecretResults {
results: ListSecretResult[];
}
export interface SecretBackendArgs {
"backend-ids": string[];
"for-drain": boolean;
}
export interface SecretBackendConfig {
params?: AdditionalProperties;
type: string;
}
export interface SecretBackendConfigResult {
config?: SecretBackendConfig;
draining: boolean;
"model-controller": string;
"model-name": string;
"model-uuid": string;
}
export interface SecretBackendConfigResults {
"active-id": string;
results?: Record<string, SecretBackendConfigResult>;
}
export interface SecretConsumerInfoResult {
error?: Error;
label: string;
revision: number;
}
export interface SecretConsumerInfoResults {
results: SecretConsumerInfoResult[];
}
export interface SecretContentParams {
data?: Record<string, string>;
"value-ref"?: SecretValueRef;
}
export interface SecretContentResult {
"backend-config"?: SecretBackendConfigResult;
content: SecretContentParams;
error?: Error;
"latest-revision"?: number;
}
export interface SecretContentResults {
results: SecretContentResult[];
}
export interface SecretRevision {
"backend-name"?: string;
"create-time"?: string;
"expire-time"?: string;
revision: number;
"update-time"?: string;
"value-ref"?: SecretValueRef;
}
export interface SecretRevisionArg {
"pending-delete": boolean;
revisions: number[];
uri: string;
}
export interface SecretRotatedArg {
"original-revision": number;
skip: boolean;
uri: string;
}
export interface SecretRotatedArgs {
args: SecretRotatedArg[];
}
export interface SecretTriggerChange {
"next-trigger-time": string;
revision?: number;
uri: string;
}
export interface SecretTriggerWatchResult {
changes: SecretTriggerChange[];
error?: Error;
"watcher-id": string;
}
export interface SecretValueRef {
"backend-id": string;
"revision-id": string;
}
export interface SecretValueResult {
data?: Record<string, string>;
error?: Error;
}
export interface StringResult {
error?: Error;
result: string;
}
export interface StringResults {
results: StringResult[];
}
export interface StringsWatchResult {
changes?: string[];
error?: Error;
"watcher-id": string;
}
export interface StringsWatchResults {
results: StringsWatchResult[];
}
export interface UpdateSecretArg {
UpsertSecretArg: UpsertSecretArg;
content?: SecretContentParams;
description?: string;
"expire-time"?: string;
label?: string;
params?: AdditionalProperties;
"rotate-policy"?: string;
uri: string;
}
export interface UpdateSecretArgs {
args: UpdateSecretArg[];
}
export interface UpsertSecretArg {
content?: SecretContentParams;
description?: string;
"expire-time"?: string;
label?: string;
params?: AdditionalProperties;
"rotate-policy"?: string;
}
export interface AdditionalProperties {
[key: string]: any;
}
/**
SecretsManagerAPI is the implementation for the SecretsManager facade.
*/
declare class SecretsManagerV2 implements Facade {
static NAME: string;
static VERSION: number;
NAME: string;
VERSION: number;
_transport: Transport;
_info: ConnectionInfo;
constructor(transport: Transport, info: ConnectionInfo);
/**
CreateSecretURIs creates new secret URIs.
*/
createSecretURIs(params: CreateSecretURIsArg): Promise<StringResults>;
/**
CreateSecrets creates new secrets.
*/
createSecrets(params: CreateSecretArgs): Promise<StringResults>;
/**
GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets.
This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook.
*/
getConsumerSecretsRevisionInfo(params: GetSecretConsumerInfoArgs): Promise<SecretConsumerInfoResults>;
/**
GetSecretBackendConfigs gets the config needed to create a client to secret backends.
*/
getSecretBackendConfigs(params: SecretBackendArgs): Promise<SecretBackendConfigResults>;
/**
GetSecretContentInfo returns the secret values for the specified secrets.
*/
getSecretContentInfo(params: GetSecretContentArgs): Promise<SecretContentResults>;
/**
GetSecretMetadata returns metadata for the caller's secrets.
*/
getSecretMetadata(params: any): Promise<ListSecretResults>;
/**
GetSecretRevisionContentInfo returns the secret values for the specified secret revisions.
*/
getSecretRevisionContentInfo(params: SecretRevisionArg): Promise<SecretContentResults>;
/**
RemoveSecrets removes the specified secrets.
*/
removeSecrets(params: DeleteSecretArgs): Promise<ErrorResults>;
/**
SecretsGrant grants access to a secret for the specified subjects.
*/
secretsGrant(params: GrantRevokeSecretArgs): Promise<ErrorResults>;
/**
SecretsRevoke revokes access to a secret for the specified subjects.
*/
secretsRevoke(params: GrantRevokeSecretArgs): Promise<ErrorResults>;
/**
SecretsRotated records when secrets were last rotated.
*/
secretsRotated(params: SecretRotatedArgs): Promise<ErrorResults>;
/**
UpdateSecrets updates the specified secrets.
*/
updateSecrets(params: UpdateSecretArgs): Promise<ErrorResults>;
/**
WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers.
*/
watchConsumedSecretsChanges(params: Entities): Promise<StringsWatchResults>;
/**
WatchObsolete returns a watcher for notifying when:
- a secret owned by the entity is deleted
- a secret revision owed by the entity no longer
has any consumers
Obsolete revisions results are "uri/revno" and deleted
secret results are "uri".
*/
watchObsolete(params: Entities): Promise<StringsWatchResult>;
/**
WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config.
*/
watchSecretRevisionsExpiryChanges(params: Entities): Promise<SecretTriggerWatchResult>;
/**
WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config.
*/
watchSecretsRotationChanges(params: Entities): Promise<SecretTriggerWatchResult>;
}
export default SecretsManagerV2;