List Secrets

In this example we will list all the secret names available that have the string demo in their name.

You will not see any secret values with this command, only the names.

curl -X "GET" \
"https://<url.kelvin.ai>/api/v4/secrets/list?search=demo" \
-H "Authorization: Bearer <Your Current Token>" \
-H "Accept: application/json"

The response will look like this;

{
    "data": [
        {
            "name": "demosecret"
        }
    ],
    "pagination": {
        "next_page": null,
        "previous_page": null,
        "page_size": 20
    }
}
from kelvin.api.client import Client

# Login
client = Client(config={"url": "https://<url.kelvin.ai>", "username": "<your_username>"})
client.login(password="<your_password>")

# List Secrets with Filter
response = client.secret.list_secrets(search="demo")

print(response)

You will see the output like this;

[Secret(name='demosecret')]
kelvin secret list --filter demo

You will need to confirm the delete process and if everything went well you will get the confirmation response like this;

[kelvin.sdk][2024-03-19 21:20:52][I] Retrieving platform secrets..
[kelvin.sdk][2024-03-19 21:20:54][I] *************************** Secrets ***************************
+---------------+
| Secret name   |
|---------------|
| demosecret    |
+---------------+