Skip to content

Resources

All operations require authentication.

3 operationsv2/iam/resource
Agent setup

List resourcesProduction

GET
/v2/iam/resource

Returns the resources of the account. Filter by resourceType, resourceName, resourceURN pattern and tag filters.

Query parameters

resourceName
string[]

Filter resources for specific resource names

resourceType
string[]

Filter resources for specific resource types

resourceURN
string[]

Filter resources for specific resource URN patterns

tags
object

Filter resources using tag filters

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200Resource[]successful operation
displayName
read-only
string

Resource display name

id
read-only
stringuuid

Identifier of the resource

name
read-only
string

Resource name

owner
read-only
string

Resource owner

tags
object

Resource tags. Tags that were internally computed are prefixed with ovh:

type
read-only
string

Resource type. All types can be retrieved at /reference/resource/type.

urn
read-only
string

Unique resource name used in policies

Reads your token from $OVH_TOKEN

$ curl https://api.eu.ovhcloud.com/v2/iam/resource \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "displayName": "string", "id": "00000000-0000-0000-0000-000000000000", "name": "string", "owner": "string", "tags": { "key": "string" }, "type": "string", "urn": "string" }]

Get a resourceProduction

GET
/v2/iam/resource/{resourceURN}

Returns the details of a resource identified by its URN.

Path parameters

resourceURN
required
string

ResourceURN

Response

200Resourcesuccessful operation
displayName
read-only
string

Resource display name

id
read-only
stringuuid

Identifier of the resource

name
read-only
string

Resource name

owner
read-only
string

Resource owner

tags
object

Resource tags. Tags that were internally computed are prefixed with ovh:

type
read-only
string

Resource type. All types can be retrieved at /reference/resource/type.

urn
read-only
string

Unique resource name used in policies

Example uses resourceURN = string

$ curl https://api.eu.ovhcloud.com/v2/iam/resource/{resourceURN} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "displayName": "string", "id": "00000000-0000-0000-0000-000000000000", "name": "string", "owner": "string", "tags": { "key": "string" }, "type": "string", "urn": "string"}

Check authorizations on a resourceProduction

POST
/v2/iam/resource/{resourceURN}/authorization/check

Checks the listed actions on this resource. Returns the actions that are authorized and those that are not.

Path parameters

resourceURN
required
string

ResourceURN

Request body (required)

actions
required
string[]

List of actions to check authorizations for

Response

200AuthorizeResponsesuccessful operation
authorizedActions
read-only
string[]

Actions from your request that the caller is allowed to perform on the resource

unauthorizedActions
read-only
string[]

Actions from your request that the caller is not allowed to perform on the resource

Example uses resourceURN = string

$ curl https://api.eu.ovhcloud.com/v2/iam/resource/{resourceURN}/authorization/check \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "authorizedActions": [ "string" ], "unauthorizedActions": [ "string" ]}