Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Querying Permissions Assignment Records

Updated on 2024-11-18 GMT+08:00

Function

This API is used to query permissions assignment records of a specified account.

The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.

Debugging

You can debug this API in API Explorer.

URI

GET /v3.0/OS-PERMISSION/role-assignments

Table 1 Query parameters

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Account ID. For details about how to obtain the account ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

role_id

No

String

Policy ID.

subject

No

String

Principal. The value can be user, group, or agency. This parameter is exclusive with subject.user_id, subject.group_id, and subject.agency_id.

subject.user_id

No

String

ID of the IAM user. For details about how to obtain the ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

subject.group_id

No

String

ID of the user group. For details about how to obtain the ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

subject.agency_id

No

String

Agency ID. For details about how to obtain the agency ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

scope

No

String

Authorization scope. The value can be project, domain, or enterprise_project. This parameter is mutually exclusive with scope.project_id, scope.domain_id, and scope.enterprise_projects_id.

NOTE:
  • To view global service authorization records, set this parameter to domain or specify scope.domain_id.
  • To view resource-based authorization records, set this parameter to domain and is_inherited to true.
  • To view project-based authorization records, set this parameter to project or specify scope.project_id.
  • To view enterprise project-based authorization records, set this parameter to enterprise_project or specify scope.enterprise_project_id.

scope.project_id

No

String

Project ID. For details about how to obtain the project ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

scope.domain_id

No

String

Account ID. For details about how to obtain the account ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

scope.enterprise_projects_id

No

String

ID of the authorized enterprise project. For details about how to obtain the ID, see How Do I Obtain an Enterprise Project ID?

is_inherited

No

Boolean

Whether to include all project-based authorization records. The default value is false. This parameter is valid only when scope is set to domain or scope.domain_id is specified. true: Query all project-based authorization records. false: Query global service authorization records.

include_group

No

Boolean

Whether to include user group-based authorization records. The default value is true. This parameter is valid only when subject is set to user or subject.user_id is specified. true: Query authorization records of IAM users and user groups which the IAM users belong to. false: Only query authorization records of IAM users.

page

No

Integer

Page number for pagination query. The minimum value is 1. This parameter must be used together with per_page.

per_page

No

Integer

Number of data records to be displayed on each page during pagination query. The value ranges from 1 to 50. This parameter must be specified together with page.

Request Parameters

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Access token issued to a user to bear its identity and permissions.

For details about the permissions required by the token, see Permissions Management.

Response Parameters

Table 3 Parameters in the response body

Parameter

Type

Description

total_num

Long

Total number of returned authorization records.

role_assignments

Array of RoleAssignmentBody objects

Authorization information.

Table 4 role_assignments

Parameter

Type

Description

user

RoleUserAssignmentId object

Authorized user. This parameter is only returned when the principal (subject) is set to user.

role

RoleAssignmentId object

Authorization policy.

group

RoleGroupAssignmentId object

Authorized user group. This parameter is only returned when the principal (subject) is set to group.

agency

RoleAgencyAssignmentId object

Authorization agency. This parameter is only returned when the principal (subject) is set to agency.

scope

RoleAssignmentScope object

Authorization scope.

is_inherited

Boolean

Whether the authorization is based on all projects.

Table 5 role_assignments.user

Parameter

Type

Description

id

String

IAM user ID.

Table 6 role_assignments.role

Parameter

Type

Description

id

String

Permission ID.

Table 7 role_assignments.group

Parameter

Type

Description

id

String

User group ID.

Table 8 role_assignments.agency

Parameter

Type

Description

id

String

Agency ID.

Table 9 role_assignments.scope

Parameter

Type

Description

project

RoleProjectAssignmentId object

IAM project-based authorization. This parameter is only returned when the authorization scope (scope) is set to project.

domain

RoleDomainAssignmentId object

Authorization based on global services or all projects. This parameter is only returned when the authorization scope (scope) is set to domain.

enterprise_project

RoleEnterpriseProjectAssignmentId object

Enterprise project-based authorization. This parameter is only returned when the authorization scope (scope) is set to enterprise_project.

Table 10 role_assignments.scope.project

Parameter

Type

Description

id

String

IAM project ID.

Table 11 role_assignments.scope.domain

Parameter

Type

Description

id

String

Global service ID.

Table 12 role_assignments.scope.enterprise_project

Parameter

Type

Description

id

String

Enterprise project ID.

Example Request

Request for querying permissions assignment records

GET  https://iam.myhuaweicloud.com/v3.0/OS-PERMISSION/role-assignments?{domain_id}

Example Response

Status code: 200

The request is successful.
{
    "role_assignments":{
        "group":{
            "id":"07609e7eb200250a3f7dc003cb7a4e2d"
        },
        "is_inherited":true,
        "role":{
            "id":"11e5c42d20cc349a2b9e2f8afd253f50c"
        },
        "scope":{
            "domain":{
                "id":"d78cbac186b744899480f25bd022f468"
            }
        }
    },
    "total_num":1
}

Status Codes

Status Code

Description

200

The request is successful.

400

Invalid parameters.

401

Authentication failed.

403

Access denied.

Error Codes

For details, see Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback