Help Center/ CodeArts Deploy/ API Reference/ APIs/ Managing Host Cluster Permissions/ Modifying the Host Cluster Permission Matrix
Updated on 2024-11-25 GMT+08:00

Modifying the Host Cluster Permission Matrix

Function

This API is used to modify the permission matrix of a host cluster by ID.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/host-groups/{group_id}/permissions

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

group_id

Yes

String

Host cluster ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

X-Auth-Token

Yes

String

User token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

role_id

Yes

String

Role ID

permission_name

Yes

String

Permission name: can_view, can_edit, can_delete, can_add_host, can_manage, and can_copy.

permission_value

Yes

Boolean

true: Authorized. false: Not authorized.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

region

String

Region information

role_id

String

Role ID

devuc_role_id_list

Array of strings

Role ID list

name

String

Role name

group_id

String

Host cluster ID

can_view

Boolean

Whether you have the view permission

can_edit

Boolean

Whether you have the edit permission

can_delete

Boolean

Whether you have the delete permission

can_add_host

Boolean

Whether you have the permission to add hosts

can_manage

Boolean

Whether you can manage permissions

can_copy

Boolean

Whether you have the clone permission

create_time

String

Creation time

update_time

String

Modification time

role_type

String

Role type. project-customized: Custom roles. template-project-customized: System-defined roles. template-customized-inst: System roles. cluster-creator: Cluster creator. project_admin: Project creator.

Example Requests

https://{endpoint}/v2/host-groups/2a8c2da888c04a5eaff10d0787c90ea4/permissions

{
  "permission_name" : "can_delete",
  "permission_value" : true,
  "project_id" : "7e6caf3cd9a64d5b8ea451e38221892e",
  "role_id" : "c869ebc4000c4bb9a2605c4020450ab4"
}

Example Responses

Status code: 200

OK: The request is successful.

{
  "region" : "region",
  "name" : null,
  "role_id" : "0",
  "devuc_role_id_list" : null,
  "group_id" : "2a8c2da888c04a5eaff10d0787c90ea4",
  "can_view" : true,
  "can_edit" : true,
  "can_delete" : true,
  "can_add_host" : true,
  "can_manage" : true,
  "can_copy" : true,
  "create_time" : null,
  "update_time" : null,
  "role_type" : "cluster-creator"
}

Status Codes

Status Code

Description

200

OK: The request is successful.

Error Codes

See Error Codes.