Help Center> Config> API Reference> API> Compliance> Querying an Assignment

Querying an Assignment

Function

This API is used to query an assignment based on its ID.

URI

GET /v1/resource-manager/domains/{domain_id}/policy-assignments/{policy_assignment_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Specifies the account ID.

Maximum length: 36

policy_assignment_id

Yes

String

Specifies the assignment ID.

Maximum length: 36

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

id

String

Specifies the assignment ID.

name

String

Specifies the assignment name.

description

String

Provides supplementary information about the assignment.

policy_filter

PolicyFilterDefinition object

Specifies the assignment filter.

state

String

Specifies the assignment status.

created

String

Specifies the time when the assignment was added.

updated

String

Specifies the time when the assignment was modified.

policy_definition_id

String

Specifies the ID of the policy used by the assignment.

parameters

Map<String,PolicyParameterValue>

Specifies the assignment parameters.

Table 3 PolicyFilterDefinition

Parameter

Type

Description

region_id

String

Specifies the region ID.

Maximum length: 128

resource_provider

String

Specifies the cloud service name.

Maximum length: 128

resource_type

String

Specifies the resource type.

Maximum length: 128

resource_id

String

Specifies the resource ID.

Maximum length: 256

tag_key

String

Specifies the tag key.

Maximum length: 128

tag_value

String

Specifies the tag value.

Maximum length: 256

Table 4 PolicyParameterValue

Parameter

Type

Description

value

Object

Specifies the value of the assignment parameter.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Example Request

None

Example Response

Status code: 200

Operation succeeded.

  • Example 1

    "5fb76a240f2daf0b9662a04d"
  • Example 2

    "volume-inuse-check"
  • Example 3

    "The EVS disk is non-compliant if it is unmounted"
  • Example 4

    {
      "region_id" : null,
      "resource_provider" : "evs",
      "resource_type" : "volumes",
      "resource_id" : null,
      "tag_key" : null,
      "tag_value" : null
    }
  • Example 5

    "Enabled"
  • Example 6

    "2020-11-20T07:03:00"
  • Example 7

    "2020-11-20T07:03:00"
  • Example 8

    "5fa36558aa1e6afc05a3d0a7"
  • Example 9

    { }

Status Codes

Status Code

Description

200

Operation succeeded.

400

Invalid parameter.

403

Authentication failed or you do not have the operation permission.

404

No assignments found.

500

Internal server error.

Error Codes

See Error Codes.