- What's New
- Service Overview
- Getting Started
-
User Guide
- Resource List
- Resource Recorder
-
Resource Compliance
- Overview
- Rules
- Organization Rules
- Viewing Noncompliant Resources
- Compliance Rule Concepts
-
Built-In Policies
- Predefined Policy List
-
General Policies
- Resource Names Meet Regular Expression Requirements
- Resources Have All the Specified Tags Attached
- Resources Have One of the Specified Tags Attached
- Tag Prefixes and Suffixes Check
- Resources Have at Least One Tags Attached
- Resource Tag Check
- Resources Are in Specified Enterprise Projects
- Resources Are in Specified Regions
- Resource Type Check by Specifying Allowed Resource Types
- Resource Type Check by Specifying Unallowed Resource Types
- API Gateway
- CodeArts Deploy
- MapReduce Service
- NAT Gateway
- VPC Endpoint
- Web Application Firewall
- Elastic Load Balance
- Elastic IP
- Auto Scaling
- Scalable File Service Turbo (SFS Turbo)
-
Elastic Cloud Server
- Flavor Check
- Image Check
- Image Check by Tag
- Security Group Check by ID
- VPC Check by ID
- ECSs Have Key Pairs Attached
- ECSs Cannot Be Accessed Through Public Networks
- An ECS Does Not Have Multiple EIPs Attached
- Idle ECS Check
- ECSs Have IAM Agencies Attached
- Image Check by Name
- ECSs Have Backup Vaults Attached
- Backup Time Check
- ECSs Have HSS Agents Attached
-
Distributed Cache Service
- DCS Memcached Instances Support SSL
- DCS Memcached Instances Are in a Specified VPC
- DCS Memcached Instances Do Not Have EIPs Attached
- Access Mode Check
- DCS Redis Instances Support SSL
- Cross-AZ Deployment Check
- DCS Redis Instances Are in the Specified VPC
- DCS Redis Instances Do Not Have EIPs Attached
- Access Mode Check
- FunctionGraph
- Content Delivery Network (CDN)
- Config
- Data Warehouse Service
- Data Replication Service
- Data Encryption Workshop
-
Identity and Access Management
- Key Rotation Check
- IAM Policies Do Not Allow Blocked Actions on KMS Keys
- Each User Group Has at Least One User
- Password Strength Check
- Unintended Policy Check
- Admin Permissions Check
- Custom Policies Do Not Allow All Actions for a Service
- The Root User Does Not Have Available Access Keys
- Access Mode Check
- Access Key Check
- IAM Users Are in Specified User Groups
- Last Login Check
- Multi-Factor Authentication Check
- A User Does Not have Multiple Active Access Keys
- MFA Has Been Enabled for Console Login
- The Root User Has MFA Enabled
- All IAM Policies Are in Use
- All IAM Roles Are in Use
- Login Protection Check
- IAM Agencies Contain Specified Policies
- The Admin User Group Only Contains the Root User
- IAM Users Do Not Have Directly Assigned Policies or Permissions
- Document Database Service
- Simple Message Notification
- Virtual Private Cloud
- Virtual Private Network
- Cloud Eye
- Cloud Container Engine
-
Cloud Trace Service
- CTS Trackers Have Traces Encrypted
- CTS Trackers Have Trace Transfer to LTS Enabled
- CTS Trackers Have Been Created for the Specified OBS Bucket
- Trace File Verification Is Enabled
- At Least One Tracker Is Enabled
- There Are CTS Trackers In the Specified Regions
- CTS Trackers Comply with Security Best Practices
-
Relational Database Service
- Error Log Collection Is Enabled for RDS Instances
- Error Log Collection Is Enabled for RDS Instances
- RDS Instances Support Slow Query Logs
- Single-AZ Cluster Check
- RDS Instances Do Not Have EIPs Attached
- RDS Instances Use KMS Encryption
- RDS Instances Are in the Specified VPC
- Both Error Logs and Slow Query Logs Are Collected for RDS Instances
- Flavor Check
- RDS Instances Have SSL Enabled
- RDS Instance Port Check
- Version Check for RDS Instance Engines
- RDS Instances Have Audit Log Enabled
- GaussDB
- TaurusDB
- GeminiDB
-
Cloud Search Service
- CSS Clusters Have the Security Mode Enabled
- The Snapshot Function Is Enabled for CSS Clusters
- Disk Encryption Is Enabled for CSS Clusters
- HTTPS Access Is Enabled for CSS Clusters
- CSS Clusters Are in Specified VPCs
- Single-AZ CSS Cluster Check
- A CSS Cluster Has at Least Two Instances
- CSS Clusters Are Not Publicly Accessible
- CSS Clusters Support the Security Mode
- CSS Clusters Have Access Control Enabled
- CSS Clusters Have Kibana Public Access Control Enabled
- CSS Clusters Have Slow Query Log Enabled
- Elastic Volume Service
- Cloud Certificate Manager
- Distributed Message Service for Kafka
- Distributed Message Service for RabbitMQ
- Distributed Message Service for RocketMQ
- Organizations
- Cloud Firewall
- Cloud Backup and Recovery
- Object Storage Service
- Image Management Service
- Bare Metal Server
- Graph Engine Service
- Resource Compliance Event Monitoring
-
Conformance Packages
- Overview
- Conformance Packages
- Organization Conformance Packages
- Custom Conformance Packages
-
Conformance Package Templates
- Overview
- Conformance Package for Classified Protection of Cybersecurity Level 3 (2.0)
- Conformance Package for the Financial Industry
- Conformance Package for Network Security
- Conformance Package for Identity and Access Management
- Conformance Package for Cloud Eye
- Conformance Package for Compute Services
- Conformance Package for ECS
- Conformance Package for ELB
- Conformance Package for Management and Regulatory Services
- Conformance Package for RDS
- Conformance Package for AS
- Conformance Package for CTS
- Conformance Package for AI and Machine Learning
- Conformance Package for Autopilot
- Conformance Package for Enabling Public Access
- Conformance Package for Logging and Monitoring
- Conformance Package for Architecture Reliability
- Conformance Package for Hong Kong Monetary Authority of China Requirements
- Conformance Package for ENISA Requirements
- Conformance Package for SWIFT CSP
- Conformance Package for Germany Cloud Computing Compliance Criteria Catalogue
- Conformance Package for PCI DSS
- Conformance Package for Healthcare Industry
- Best Practices of Network and Data Security
- Conformance Package for Landing Zone
- Architecture Security Best Practices
- Best Practices for Network and Content Delivery Service Operations
- Best Practices for Idle Asset Management
- Multi-AZ Deployment Best Practices
- Resource Stability Best Practices
- Best Practices for API Gateway
- Best Practices for Cloud Container Engine
- Best Practices for Content Delivery Network
- Best Practices for FunctionGraph
- Best Practices for GaussDB
- Best Practices for GeminiDB
- Best Practices for MapReduce Service
- Best Practices for NIST Requirements
- Best Practices for Singapore Financial Industry
- Best Practices for Secure Identity and Compliance Operations
- Conformance Package for Huawei Cloud Security Configuration Guide (Level 1)
- Conformance Package for Huawei Cloud Security Configuration Guide (Level 2)
- Best Practices for Static Data Encryption
- Best Practices for Data Transmission Encryption
- Best Practices for Cloud Backup and Recovery
- Best Practices for Cloud Search Service
- Best Practices for Distributed Cache Service
- Best Practices for Distributed Message Service
- Best Practices for Data Warehouse Service
- Best Practices for TaurusDB
- Best Practices for Object Storage Service
- Best Practices for Virtual Private Cloud
- Best Practices for Web Application Firewall
- Advanced Queries
- Resource Aggregation
- Cloud Trace Service
- Appendix
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs
-
Resource List
- Querying Resources of a Specific Type
- Querying Cloud Services
- Querying a Resource
- Querying All Resources Recorded by the Resource Recorder
- Querying How Many Resources Are Recorded by the Resource Recorder
- Querying Resource Tags Recorded by the Resource Recorder
- Querying Resource Overview Recorded by the Resource Recorder
- Querying a Specific Resource Recorded by the Resource Recorder
- Querying All Resources Under an Account
- Querying a Resource Under an Account
- Querying Resource Tags
- Querying the Number of Resources
- Querying Resource Overview
- Resource Recorder
- Resource Relationships
- Resource Change Records
-
Compliance
- Querying Built-in Policies
- Querying Specific Built-in Policy
- Adding a Rule
- Querying Rules
- Modifying a Rule
- Querying a Specific Rule
- Deleting a Rule
- Enabling a Rule
- Disabling a Rule
- Running a Resource Compliance Evaluation
- Querying the Evaluation Status of a Rule
- Querying the Compliance of a Resource
- Querying the Compliance of a Rule
- Querying Compliance of an Account
- Updating the Compliance Result
- Creating an Organization Rule
- Querying Organization Rules
- Querying a Specific Organization Rule
- Deleting an Organization Rule
- Updating an Organization Rule
- Querying the Deployment Status of an Organization Rule
- Querying Statuses of Organization Rule Deployment to Member Accounts
- Setting up or Updating Remediation Configurations
- Querying Remediation Configurations
- Deleting Remediation Configurations
- Batch Creating Remediation Exceptions
- Batch Deleting Remediation Exceptions
- Querying Remediation Exceptions
- Starting Remediation
- Querying Remediation Results
- Collect Remediation Results
- Region Management
- Advanced Queries
-
Resource Aggregators
- Creating a Resource Aggregator
- Querying Resource Aggregators
- Querying a Specific Resource Aggregator
- Querying Account Aggregation Statuses of a Specific Aggregator
- Updating a Resource Aggregator
- Deleting a Resource Aggregator
- Authorizing an Aggregator Account
- Querying Authorized Aggregator Accounts
- Deleting Authorization for an Aggregator Account
- Querying All Pending Aggregation Requests
- Deleting Pending Authorization Requests
- Querying the Number of Resources of an Aggregator Account
- Querying Resources of an Aggregator Account
- Querying Details About a Specific Resource in a Source Account
- Performing an Advanced Query on a Specific Aggregator
- Querying the Compliance Summary of One or More Source Accounts in an Aggregator
- Querying Aggregated Rules
- Querying Compliance Results of Aggregated Resources
- Querying Details About a Specified Aggregated Rule
-
Conformance Packages
- Querying Conformance Packages
- Creating a Conformance Package
- Querying a Specific Conformance Package
- Deleting a Conformance Package
- Updating Conformance Packages
- Querying Compliance of all Conformance Packages
- Querying Compliance of all Rules in a Conformance Package
- Querying Compliance of All Resources Evaluated with a Conformance Package
- Querying Scores of All Conformance Packages
- Querying Built-in Conformance Package Templates
- Querying the Template of a Built-in Conformance Package
- Creating organization conformance packages.
- Querying Organization Conformance Packages
- Querying an Organization Conformance Package
- Delete organization conformance packages.
- Updating Organization Conformance Packages
- Querying the Deployment Status of the Organization Conformance Package
- Querying the Statuses of Organization Conformance Package Deployment to Members.
- Resource Tags
-
Resource List
- Permissions Policies and Supported Actions
- Appendixes
- SDK Reference
-
Best Practices
- Creating Rules
- Querying Resource Details, Relationships, and Change Records
- Creating Alarm Rules for Noncompliant Resources with Cloud Eye
- Using Advanced Queries
- Querying Resources That Do Not Have Specific Tags
- Ensuring Resource Compliance by Tag, Region, and Organization
- Automating Resource Management
- FAQs
- General Reference
Copied.
Making an API Request
This section describes the structure of a REST API request, and uses the IAM API for creating an IAM User as an example to demonstrate how to call an API. The obtained token can then be used to authenticate the calling of other APIs.
Request URI
A request URI is in the following format:
{URI-scheme}://{Endpoint}/{resource-path}?{query-string}
Although a request URI is included in the request header, most programming languages or frameworks require the request URI to be transmitted separately.
Parameter |
Description |
---|---|
URI-scheme |
Protocol used to transmit requests. All APIs use HTTPS. |
Endpoint |
Domain name or IP address of the server bearing the REST service. The endpoint varies between services in different regions. It can be obtained from Regions and Endpoints. For example, the endpoint of IAM in region CN-Hong Kong is iam.ap-southeast-1.myhuaweicloud.com. |
resource-path |
Access path of an API for performing a specified operation. Obtain the path from the URI of an API. For example, the resource-path of the API used to obtain a user token is /v3/auth/tokens. |
query-string |
Query parameter, which is optional. Ensure that a question mark (?) is included before each query parameter that is in the format of Parameter name=Parameter value. For example, ? limit=10 indicates that a maximum of 10 data records will be displayed. |
IAM is a global service. You can create an IAM user using the endpoint of IAM in any region. For example, to create an IAM user in the CN-Hong Kong region, obtain the endpoint of IAM (iam.ap-southeast-1.myhuaweicloud.com) for this region and the resource-path (/v3.0/OS-USER/users) in the URI of the API for creating an IAM user. Then construct the URI as follows:
1 |
https://iam.ap-southeast-1.myhuaweicloud.com/v3.0/OS-USER/users |

To simplify the URI display in this document, each API is provided only with a resource-path and a request method. The URI-scheme of all APIs is HTTPS, and the endpoints of all APIs in the same region are identical.
Request Methods
Method |
Description |
---|---|
GET |
Requests the server to return specified resources. |
PUT |
Requests the server to update specified resources. |
POST |
Requests the server to add resources or perform special operations. |
DELETE |
Requests the server to delete specified resources, for example, an object. |
HEAD |
Same as GET except that the server must return only the response header. |
PATCH |
Requests the server to update partial content of a specified resource. If the resource does not exist, a new resource will be created. |
For example, in the case of the API for creating an IAM user, the request method is POST. An example request is as follows:
POST https://iam.ap-southeast-1.myhuaweicloud.com/v3.0/OS-USER/users
Request Header
You can also add additional header fields to a request, such as the fields required by a specified URI or HTTP method. For example, to request for the authentication information, add Content-Type, which specifies the request body type.
Parameter |
Description |
Mandatory |
Example Value |
---|---|---|---|
Host |
Specifies the server domain name and port number of the resources being requested. The value can be obtained from the URL of the service API. The value is in the format of Hostname:Port number. If the port number is not specified, the default port is used. The default port number for https is 443. |
No This field is mandatory for AK/SK authentication. |
code.test.com or code.test.com:443 |
Content-Type |
Specifies the type (or format) of the message body. The default value application/json is recommended. Other values of this field will be provided for specific APIs if any. |
Yes |
application/json |
Content-Length |
Specifies the length of the request body. The unit is byte. |
No |
3495 |
X-Project-Id |
Specifies the project ID. Obtain the project ID by following the instructions in Obtaining a Project ID. |
No This field is mandatory for requests that use AK/SK authentication in the Dedicated Cloud (DeC) scenario or multi-project scenario. |
e9993fc787d94b6c886cbaa340f9c0f4 |
X-Auth-Token |
Specifies the user token. It is a response to the API for obtaining a user token (This is the only API that does not require authentication). After the request is processed, the value of X-Subject-Token in the response header is the token value. |
No This field is mandatory for token authentication. |
The following is part of an example token: MIIPAgYJKoZIhvcNAQcCo...ggg1BBIINPXsidG9rZ |
In addition to supporting authentication using tokens, APIs support authentication using AK/SK, which uses SDKs to sign a request. During the signature, the Authorization (signature authentication) and X-Sdk-Date (time when a request is sent) headers are automatically added in the request.
For more details, see "Authentication Using AK/SK" in Authentication.
The following shows an example request of the API for creating an IAM user when AK/SK authentication is used:
POST https://iam.ap-southeast-1.myhuaweicloud.com/v3.0/OS-USER/users Content-Type: application/json X-Sdk-Date: 20240416T095341Z Authorization: SDK-HMAC-SHA256 Access=****************, SignedHeaders=content-type;host;x-sdk-date, Signature=****************
(Optional) Request Body
This part is optional. A request body is generally sent in a structured format (for example, JSON or XML), which is specified by Content-Type in the request header. It is used to transfer content other than the request header. If the request body contains full-width characters, these characters must be coded in UTF-8.
The request body varies depending on APIs. Certain APIs do not require the request body, such as the APIs requested using the GET and DELETE methods.
The following shows an example request (a request body included) of the API for creating an IAM user. You can learn about request parameters and related description from this example. The bold parameters need to be replaced for a real request.
- accountid: account ID of an IAM user
- username: name of an IAM user
- email: email of an IAM user
- password: login password of an IAM user
POST https://iam.ap-southeast-1.myhuaweicloud.com/v3.0/OS-USER/users Content-Type: application/json X-Sdk-Date: 20240416T095341Z Authorization: SDK-HMAC-SHA256 Access=****************, SignedHeaders=content-type;host;x-sdk-date, Signature=**************** { "user": { "domain_id": "accountid", "name": "username", "password": "**********", "email": "email", "description": "IAM User Description" } }
If all data required for the API request is available, you can send the request to call the API through curl, Postman, or coding. In the response to the API used to obtain a user token, X-Subject-Token is the desired user token. This token can then be used to authenticate the calling of other APIs.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot