Skip to content

Security Groups

All operations require authentication.

5 operationsv2/publicCloud/project
Agent setup

List security groupsProduction

GET
/v2/publicCloud/project/{projectId}/securityGroup

Returns the security groups of the project.

Path parameters

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200SecurityGroup[]successful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the security group

currentState
read-only
SecurityGroupCurrentState

Current state of the security group

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the security group

id
read-only
stringuuid

Unique identifier of the security group

resourceStatus
read-only
ResourceStatusEnum

Security group readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SecurityGroupTargetSpec

Last target specification of the security group

updatedAt
read-only
stringdate-time

Last update date of the security group

Example uses projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/securityGroup \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "defaultRules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ], "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "updatedAt": "2024-01-01T12:00:00Z" }]

Get a security groupProduction

GET
/v2/publicCloud/project/{projectId}/securityGroup/{securityGroupId}

Returns the security group, including its rules and default egress rules.

Path parameters

projectId
required
string

Project ID

securityGroupId
required
stringuuid

Security group ID

Response

200SecurityGroupsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the security group

currentState
read-only
SecurityGroupCurrentState

Current state of the security group

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the security group

id
read-only
stringuuid

Unique identifier of the security group

resourceStatus
read-only
ResourceStatusEnum

Security group readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SecurityGroupTargetSpec

Last target specification of the security group

updatedAt
read-only
stringdate-time

Last update date of the security group

404objectError 404 response

Example uses projectId = string, securityGroupId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/securityGroup/{securityGroupId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "defaultRules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ], "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "updatedAt": "2024-01-01T12:00:00Z"}

Create a security groupProduction

POST
/v2/publicCloud/project/{projectId}/securityGroup

Creates a security group with inline rules. OpenStack adds default egress rules automatically.

Path parameters

projectId
required
string

Project ID

Request body (required)

targetSpec
required
SecurityGroupTargetSpec

Desired target specification for the security group to create

Response

200SecurityGroupsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the security group

currentState
read-only
SecurityGroupCurrentState

Current state of the security group

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the security group

id
read-only
stringuuid

Unique identifier of the security group

resourceStatus
read-only
ResourceStatusEnum

Security group readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SecurityGroupTargetSpec

Last target specification of the security group

updatedAt
read-only
stringdate-time

Last update date of the security group

409objectError 409 response

Example uses projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/securityGroup \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "defaultRules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ], "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "updatedAt": "2024-01-01T12:00:00Z"}

Delete a security groupProduction

DELETE
/v2/publicCloud/project/{projectId}/securityGroup/{securityGroupId}

Deletes the security group. Deletion is not blocked for a group still attached to interfaces or the project's default group.

Path parameters

projectId
required
string

Project ID

securityGroupId
required
stringuuid

Security group ID

Response

200SecurityGroupsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the security group

currentState
read-only
SecurityGroupCurrentState

Current state of the security group

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the security group

id
read-only
stringuuid

Unique identifier of the security group

resourceStatus
read-only
ResourceStatusEnum

Security group readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SecurityGroupTargetSpec

Last target specification of the security group

updatedAt
read-only
stringdate-time

Last update date of the security group

404objectError 404 response
409objectError 409 response

Example uses projectId = string, securityGroupId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/securityGroup/{securityGroupId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "defaultRules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ], "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "updatedAt": "2024-01-01T12:00:00Z"}

Update a security groupProduction

PUT
/v2/publicCloud/project/{projectId}/securityGroup/{securityGroupId}

Replaces the security group's name, description and rules as a whole.

Path parameters

projectId
required
string

Project ID

securityGroupId
required
stringuuid

Security group ID

Request body (required)

checksum
string

Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins).

targetSpec
required
SecurityGroupUpdateTargetSpec

Desired target specification for the security group

Response

200SecurityGroupsuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the security group

currentState
read-only
SecurityGroupCurrentState

Current state of the security group

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the security group

id
read-only
stringuuid

Unique identifier of the security group

resourceStatus
read-only
ResourceStatusEnum

Security group readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
SecurityGroupTargetSpec

Last target specification of the security group

updatedAt
read-only
stringdate-time

Last update date of the security group

404objectError 404 response
409objectError 409 response

Example uses projectId = string, securityGroupId = 00000000-0000-0000-0000-000000000000

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/securityGroup/{securityGroupId} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "defaultRules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ], "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "id": "00000000-0000-0000-0000-000000000000", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "currentTasks": [ { "errors": [ { "message": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "link": "string", "status": "ERROR", "type": "string" } ], "id": "00000000-0000-0000-0000-000000000000", "resourceStatus": "CREATING", "targetSpec": { "description": "string", "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "rules": [ { "description": "string", "direction": "EGRESS", "ethernetType": "IPV4", "portRangeMax": 0, "portRangeMin": 0, "protocol": "AH", "remoteGroup": { "id": "00000000-0000-0000-0000-000000000000" }, "remoteIpPrefix": "192.0.2.0/24" } ] }, "updatedAt": "2024-01-01T12:00:00Z"}