from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
security_group = client.cloud.security_groups.update(
group_id="group_id",
project_id=0,
region_id=0,
)
print(security_group.id)
{
"created_at": "2019-06-18T11:56:16+0000",
"description": "Some description",
"id": "00000000-0000-4000-8000-000000000000",
"name": "my_security_group",
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"revision_number": 1,
"security_group_rules": [
{
"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"
}
],
"tags_v2": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"updated_at": "2019-06-18T11:57:00+0000"
}
Update the configuration of an existing security group.
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
security_group = client.cloud.security_groups.update(
group_id="group_id",
project_id=0,
region_id=0,
)
print(security_group.id)
{
"created_at": "2019-06-18T11:56:16+0000",
"description": "Some description",
"id": "00000000-0000-4000-8000-000000000000",
"name": "my_security_group",
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"revision_number": 1,
"security_group_rules": [
{
"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"
}
],
"tags_v2": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"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
Updated security group details
The response is of type object
.
Was this page helpful?