import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
client_profile = client.security.profiles.get(
0,
)
print(client_profile.id){
"id": 123,
"profile_template": {
"id": 123,
"name": "<string>",
"fields": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"field_type": "int",
"required": true,
"default": "<string>",
"validation_schema": {}
}
],
"version": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"description": "<string>",
"base_template": 123,
"template_sifter": "<string>"
},
"fields": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"field_type": "<string>",
"required": true,
"default": "<string>",
"base_field": 123,
"validation_schema": {},
"field_value": "<unknown>"
}
],
"site": "<string>",
"options": {
"bgp": true,
"active": true,
"price": "<string>"
},
"protocols": [
{}
],
"status": {},
"plan": "<string>",
"ip_address": "<string>"
}Get profile by id
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
client_profile = client.security.profiles.get(
0,
)
print(client_profile.id){
"id": 123,
"profile_template": {
"id": 123,
"name": "<string>",
"fields": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"field_type": "int",
"required": true,
"default": "<string>",
"validation_schema": {}
}
],
"version": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created": "2023-11-07T05:31:56Z",
"description": "<string>",
"base_template": 123,
"template_sifter": "<string>"
},
"fields": [
{
"id": 123,
"name": "<string>",
"description": "<string>",
"field_type": "<string>",
"required": true,
"default": "<string>",
"base_field": 123,
"validation_schema": {},
"field_value": "<unknown>"
}
],
"site": "<string>",
"options": {
"bgp": true,
"active": true,
"price": "<string>"
},
"protocols": [
{}
],
"status": {},
"plan": "<string>",
"ip_address": "<string>"
}API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Show child attributes
100Show child attributes
30255int - Intbool - Boolstr - Strint, bool, str 100Show child attributes
Region where the protection profiles will be deployed
50Was this page helpful?