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.

API cURL Example
1
2
3
4
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;

API cURL Example Response
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
    "data": [
        {
            "name": "demosecret"
        }
    ],
    "pagination": {
        "next_page": null,
        "previous_page": null,
        "page_size": 20
    }
}
API Client (Python) Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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;

API Client (Python) Example Response
1
[Secret(name='demosecret')]
Kelvin SDK Command Line Example
1
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 Command Line Output
1
2
3
4
5
6
7
[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    |
+---------------+