Secrets¶
Manage secrets in your application.
list¶
Retrieves a paginated list of all secrets stored in the profile with filtering and sorting options.
See: Secrets
Parameters:
Optional queryObj: SecretsQuery(Query)Query parameters to filter the results.Default queryObj:¶queryObj = { "page": 1, "fields": ["id", "key"], "filter": {}, "amount": 20, "orderBy": ["key", "asc"] }Returns:
list[SecretsInfo]# If receive an error "Authorization Denied", check policy "Secrets" / "Access" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.secrets.list({ "page": 1, "fields": ["id", "key"], "amount": 20 }) print(result) # [ { 'id': 'secret-id-123', 'key': 'API_KEY' } ]
info¶
Retrieves detailed information about a specific secret using its ID.
See: Secrets
Parameters:
secretID: strSecret IDReturns:
# If receive an error "Authorization Denied", check policy "Secrets" / "Access" in Access Management. from tagoio_sdk import Resources resources = Resources() secret_info = resources.secrets.info("secret-id-123") print(secret_info) # { 'id': 'secret-id-123', 'key': 'API_KEY' }
create¶
Creates a new secret in the profile with the specified key and value.
See: Creating a Secret
Parameters:
secretObj: SecretsCreateSecret informationReturns:
dict[str, GenericID]# If receive an error "Authorization Denied", check policy "Secrets" / "Create" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.secrets.create({ "key": "API_KEY", "value": "my-secret-value" }) print(result) # { 'id': 'secret-id-132' }
edit¶
Modifies the properties of an existing secret.
See: Secrets
Parameters:
secretID: strSecret IDsecretObj: SecretsEditSecret information to updateReturns:
string# If receive an error "Authorization Denied", check policy "Secrets" / "Edit" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.secrets.edit("secret-id-123", { "value": "new-secret-value", "tags": [{"key": "type", "value": "user"}] }) print(result) # Successfully Updated
delete¶
Permanently removes a secret from the profile.
See: Secrets
Parameters:
secretID: strSecret IDReturns:
string# If receive an error "Authorization Denied", check policy "Secrets" / "delete" in Access Management. from tagoio_sdk import Resources resources = Resources() result = resources.secrets.delete("secret-id-123") print(result) # Successfully Removed