GET
/
cloud
/
v1
/
secrets
/
{project_id}
/
{region_id}
/
{secret_id}
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
secret = client.cloud.secrets.get(
    secret_id="bfc7824b-31b6-4a28-a0c4-7df137139215",
    project_id=1,
    region_id=1,
)
print(secret.id)
{
  "algorithm": "aes",
  "bit_length": 256,
  "content_types": {
    "default": "application/octet-stream"
  },
  "created": "2023-03-23T20:00:00+00:00",
  "expiration": "2023-06-23T20:00:00+00:00",
  "id": "bfc7824b-31b6-4a28-a0c4-7df137139215",
  "mode": "cbc",
  "name": "AES key",
  "secret_type": "opaque",
  "status": "ACTIVE"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

Examples:

1

region_id
integer
required

Region ID

Examples:

1

secret_id
string<uuid4>
required

Secret ID

Examples:

"bfc7824b-31b6-4a28-a0c4-7df137139215"

Response

200 - application/json

OK

id
string
required

Secret uuid

Examples:

"bfc7824b-31b6-4a28-a0c4-7df137139215"

name
string
required

Secret name

Examples:

"AES key"

secret_type
enum<string>
required

Secret type, base64 encoded. symmetric - Used for storing byte arrays such as keys suitable for symmetric encryption; public - Used for storing the public key of an asymmetric keypair; private - Used for storing the private key of an asymmetric keypair; passphrase - Used for storing plain text passphrases; certificate - Used for storing cryptographic certificates such as X.509 certificates; opaque - Used for backwards compatibility with previous versions of the API

Available options:
certificate,
opaque,
passphrase,
private,
public,
symmetric
status
string
required

Status

Examples:

"ACTIVE"

algorithm
string | null

Metadata provided by a user or system for informational purposes. Defaults to None

Examples:

"aes"

bit_length
integer | null

Metadata provided by a user or system for informational purposes. Value must be greater than zero. Defaults to None

Examples:

256

content_types
object | null

Describes the content-types that can be used to retrieve the payload. The content-type used with symmetric secrets is application/octet-stream

Examples:
{ "default": "application/octet-stream" }
created
string<date-time> | null

Datetime when the secret was created. The format is 2020-01-01T12:00:00+00:00

Examples:

"2023-03-23T20:00:00+00:00"

expiration
string<date-time> | null

Datetime when the secret will expire. The format is 2020-01-01T12:00:00+00:00. Defaults to None

Examples:

"2023-06-23T20:00:00+00:00"

mode
string | null

Metadata provided by a user or system for informational purposes. Defaults to None

Examples:

"cbc"