from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
security_group_rule = client.cloud.security_groups.rules.create(
group_id="group_id",
project_id=0,
region_id=0,
)
print(security_group_rule.id)
{
"created_at": "2019-06-18T11:56:16+0000",
"description": "Some description",
"direction": "egress",
"ethertype": "IPv4",
"id": "00000000-0000-4000-8000-000000000000",
"port_range_max": 80,
"port_range_min": 80,
"protocol": "tcp",
"remote_group_id": "<string>",
"remote_ip_prefix": "10.0.0.0/8",
"revision_number": 0,
"security_group_id": "00000000-0000-4000-8000-000000000000",
"updated_at": "2019-06-18T11:57:00+0000"
}
Add a new rule to an existing security group.
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
security_group_rule = client.cloud.security_groups.rules.create(
group_id="group_id",
project_id=0,
region_id=0,
)
print(security_group_rule.id)
{
"created_at": "2019-06-18T11:56:16+0000",
"description": "Some description",
"direction": "egress",
"ethertype": "IPv4",
"id": "00000000-0000-4000-8000-000000000000",
"port_range_max": 80,
"port_range_min": 80,
"protocol": "tcp",
"remote_group_id": "<string>",
"remote_ip_prefix": "10.0.0.0/8",
"revision_number": 0,
"security_group_id": "00000000-0000-4000-8000-000000000000",
"updated_at": "2019-06-18T11:57:00+0000"
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project ID
Region ID
Security group ID
Created rule details
The response is of type object
.
Was this page helpful?