Vault

  • Canonical Telco
Channel Revision Published Runs on
latest/edge 89 31 Jan 2024
Ubuntu 22.04 Ubuntu 20.04
latest/edge 9 27 Jan 2023
Ubuntu 22.04 Ubuntu 20.04
1.16/stable 280 04 Oct 2024
Ubuntu 22.04
1.16/candidate 280 04 Oct 2024
Ubuntu 22.04
1.16/beta 280 04 Oct 2024
Ubuntu 22.04
1.16/edge 313 20 Dec 2024
Ubuntu 22.04
1.15/stable 248 24 Jul 2024
Ubuntu 22.04
1.15/candidate 248 24 Jul 2024
Ubuntu 22.04
1.15/beta 248 24 Jul 2024
Ubuntu 22.04
1.15/edge 248 10 Jul 2024
Ubuntu 22.04
juju deploy vault-k8s --channel 1.16/stable
Show information

Platform:

charms.vault_k8s.v0.vault_s3

S3 helper functions for Vault charms.

Usage

Add the following dependencies to the charm's requirements.txt file:

```
boto3
boto3-stubs[s3]
```

class LogAdapter

Description

Adapter for the logger to prepend a prefix to all log lines. None

Methods

LogAdapter. process( self , msg , kwargs )

Description

Decides the format for the prepended text. None

class S3Error

Description

Base class for S3 errors. None

class S3

Description

A class representing an S3 session allowing S3 operations. None

Methods

S3. __init__( self , access_key: str , secret_key: str , endpoint: str , region )

S3. create_bucket( self , bucket_name: str )

Create S3 bucket.

Arguments

bucket_name

S3 bucket name to be created.

Returns

bool

True if the bucket was created, False otherwise.

Description

If the bucket already exists, it will be skipped.

S3. upload_content( self , content , bucket_name: str , key: str )

Upload the provided contents to the provided S3 bucket.

Arguments

content

File like object containing the content to upload.

bucket_name

S3 bucket name.

key

S3 object key.

Returns

bool

True if the upload was successful, False otherwise.

S3. get_object_key_list( self , bucket_name: str , prefix: str )

Get list of object key in an S3 bucket.

Arguments

bucket_name

S3 bucket name.

prefix

Prefix to filter object keys by.

Returns

List[str]

List of object keys.

S3. get_content( self , bucket_name: str , object_key: str )

Get object content from S3 bucket by key.

Arguments

bucket_name

S3 bucket name.

object_key

S3 object key.

Returns

File like object with the content of the S3 object, or None if the object does not exist.