Attach a list of Security Groups to a NIC
1 min
PUT
https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/securitygroups
datacenterIdstringThe unique ID of the data center.
serverIdstringThe unique ID of the server.
nicIdstringThe unique ID of the server.
prettyboolean<p>Controls whether the response is pretty-printed (with indentations and new lines).</p>
depthinteger<int32><p>Controls the detail depth of the response objects. GET /datacenters/[ID]</p>
<ul>
<li>depth=0: Only direct properties are included;
children (servers and other elements) are not included.</li>
<li>depth=1: Direct properties and children references are included.</li>
<li>depth=2: Direct properties and children properties are included.</li>
<li>depth=3: Direct properties and children properties and children's children are included.</li>
<li>depth=... and so on</li>
</ul>
acceptstringGenerated from available response content types
bodyobjectThe list of NIC attached Security Groups IDs.
200Successful operation
default<p>Any erroneous status code:
400 (parse error),
401 (auth error),
402 (trial access),
403 (insufficient privileges),
404 (not found),
405 (unsupported HTTP method),
415 (unsupported content type),
422 (validation error),
429 (request rate limit exceeded),
500 (server error),
or 503 (maintenance).</p>
curl --request PUT \
--url 'https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers/{serverId}/nics/{nicId}/securitygroups?pretty=true&depth=integer%3Cint32%3E' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"ids": []
}'Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.