Update a Network Security Group

circle-info

Note: Only contract administrators, owners, and users with permissions to the VDC concerned can create and manage NSGs via API.

circle-info

Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.

circle-info

Note: User-created Virtual Machines (VMs) can be Default or Custom NSG members, but you cannot add nodes from the Managed Kubernetes node pools or suspended Cubes.

To update a NSG, you need to use the following Cloud APIarrow-up-right PUTor PATCH request providing the datacenterId, securityGroupIdand the required properties:

PUT(PATCH) /datacenters/{datacenterId}/securitygroups/{securityGroupId}

Request

curl --location --request PUT 'https://api.ionos.com/cloudapi/v6/datacenters/5a88aa8b-8aa1-51f6-XXd1-XXXXXe9f31/securitygroups/b3f55c2d-a89e-4008-8213-92e0428e2555' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YYXabCDeFmLMO0c2hyYUBpb25vcy5jb206I1Bha2lzdGFuXzE=' \
--data '{
    "properties": {
        "name": "NSG",
        "description": "updated to true"
    }

}'

Response

202 Accepted

circle-info

Note: For CloudAPI, some resources are created asynchronously. You can check for the progress via the Status URL that is returned in the response header of the POST or PUT call.

Last updated

Was this helpful?