Create a Default Network Security Group
You can create a Default NSG with predefined rules at the time of creation or during the update of a datacenter. You can use any of the following Cloud API requests with the property createDefaultSecurityGroup set to trueand the other required properties:
POST /datacenters/
PUT /datacenters/{datacenterId}
PATCH /datacenters/{datacenterId}
Request
curl --location 'https://api.ionos.com/cloudapi/v6/datacenters/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YYXabCDeFmLMO0c2hyYUBpb25vcy5jb206I1Bha2lzdGFuXzE=' \
--data '{
"properties": {
"name": "Production Datacenter",
"description": "My Production Datacenter",
"location": "us/las",
"createDefaultSecurityGroup": true
}
}'Response
202 Accepted
Last updated
Was this helpful?