- What's New
- Function Overview
- Service Overview
- Billing
-
User Guide
- Enabling EdgeSec
- Site Acceleration
-
Security Protection
- Connecting a Domain Name to EdgeSec
- Dashboard
- Protection Statistics
-
Protection Policy
- Creating a Protection Policy
- Applying a Policy to Your Website
-
Configuring Protection Policies
- Configuration Guidance
- Configuring Basic Protection Rules to Defend Against Common Web Attacks
- Configuring CC Attack Protection Rules to Defend Against CC Attacks
- Configuring a Precise Protection Rule
- Creating a Reference Table to Configure Protection Metrics In Batches
- Configuring IP Address Blacklist and Whitelist Rules to Block Specified IP Addresses
- Configuring a Known Attack Source Rule
- Configuring Geolocation Access Control Rules to Block Requests from Specific Locations
- Configuring a BOT Protection Rule
- Configuring a Global Whitelist Rule to Ignore False Positives
- Configuring a Data Masking Rule
- Address Group Management
- System Management
- Permissions Management
- Key Operations Recorded by CTS
- Best Practices
-
API Reference
- Before You Start
- API Overview
- API Calling
-
API
- Protected Domain Name Management
-
HTTP Protection Policy Management
- This API is used to query the protection policy list.
- This API is used to create a protection policy.
- This API is used to query a protection policy.
- This API is used to update a protection policy.
- This API is used to delete a protection policy.
- This API is used to update domain names a policy applies to.
- This API is used to update a protection policy rule.
- EdgeSec HTTP Protection Rule Management - CC
- HTTP Protection Rule Management - Precise Protection
-
HTTP Protection Rule Management - IP Address Blacklist and Whitelist
- This API is used to query IP address blacklist and whitelist rules.
- This API is used to create an IP address blacklist or whitelist rule.
- This API is used to query an IP address blacklist or whitelist rule.
- This API is used to update an IP address blacklist or whitelist rule.
- This API is used to delete a blacklist or whitelist rule.
-
HTTP Protection Rule Management - Geographical Location
- This API is used to query the geolocation access control rules.
- This API is used to create a geolocation access control rule.
- This API is used to query a geolocation access control rule.
- This API is used to update a geolocation access control rule.
- This API is used to delete a geolocation access control rule.
-
HTTP Protection Rule Management - False Alarm Masking
- This API is used to query false alarm masking rules.
- This API is used to add a false alarm masking rule.
- This API is used to query a false alarm masking rule.
- This API is used to update a false alarm masking rule.
- This API is used to delete a false alarm masking rule.
- This API is used to reset a false alarm masking rule.
- HTTP Protection Rule Management - Attack Penalty
- IP Address Group Management
- Security Overview
- Reference Table Management
- DDoS Statistics
- HTTP Statistics
- DDoS Attack Logs
-
Appendix
- Status Code
- Error Codes
-
Troubleshooting
- EdgeSec.00000005 Invalid Parameter
- EdgeSec.00000013 Concurrent Modification Exception
- EdgeSec.00000014 Only Default Enterprise Project Supported (Not support operation in this enterprise project)
- EdgeSec.00000015 Write Operation Not Supported When All Enterprise Projects Are Selected (All enterprise projects do not support the write operation)
- EdgeSec.00000018 Migration of Resources to Non-Default Enterprise Project Not Supported (This version only supports default enterprise project)
- EdgeSec.00000019 Frozen Resources Cannot Be Migrated to or from an Enterprise Project (frozen cannot create eps tag)
- EdgeSec.00000023 Operation Not Supported by the Current Specifications
- EdgeSec.00000025 Invalid Block Time (Invalid block time)
- EdgeSec.00000026 Invalid Whitelist Rule Type (Invalid rule type)
- EdgeSec.00000027 Invalid CC Rule Condition Length (Invalid cc condition length value)
- EdgeSec.00010001 Invalid IAM Service Project (Failed to get IAM projects)
- EdgeSec.00010005 Insufficient WAF Policy Rule Quota
- EdgeSec.00010006 Blacklist and Whitelist Rules of Edge WAF Exceed the Quota
- EdgeSec.00010007 Insufficient IP Address Group Quota of Edge WAF
- EdgeSec.00010008 Insufficient Edge WAF Certificate Quota
- EdgeSec.00030001 Invalid DDoS Overview Parameters (Illegal Elasticsearch Request)
- EdgeSec.00030003 DDoS Overview Query Type Exception (Statistic Type Error)
- EdgeSec.00030002 DDoS Overview Query Type Exception (Search Error)
- EdgeSec.00040007 No Permission To Operate
- EdgeSec.00040013 Insufficient Top-Level Domain Name Quota
- EdgeSec.00040014 Expansion Resource Quota Has Been Used
- WAF.00022002 Resource Already Exists (Domain Already Exists)
- WAF.00014002 Resource Already Exists
- common.01010003 No Purchase Permission
- Obtaining a Project ID
- SDK Reference
-
FAQs
- About the Product
-
About Functions
- How Does EdgeSec Detect SQL Injection, XSS, and PHP Injection Attacks?
- How Do I Obtain the Real IP Address of a Visitor in EdgeSec?
- How Does EdgeSec Block Requests?
- Do I Need to Enable All Ports When Configuring an EdgeSec Whitelist in a Security Group?
- Why Do Cookies Contain the HWEdgeSecSESID or HWEdgeSecSESTIME field?
- Does Edge Security Support Alarm Notifications for Attacks?
- Regions and AZs
- General Reference
Copied.
Making an API Request
This section describes the structure of a REST API request, and uses the IAM API for obtaining a user token 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.
- 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.
For example, to obtain an IAM token 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/auth/tokens) in the URI of the API used to obtain a user token. Then, construct the URI as follows:
https://iam.ap-southeast-1.myhuaweicloud.com/v3/auth/tokens

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
The HTTP protocol defines the following request methods that can be used to send a request to the server:
- 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 used to obtain a user token, the request method is POST. The request is as follows:
POST https://iam.ap-southeast-1.myhuaweicloud.com/v3/auth/tokens
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.
Common request header fields are as follows:
- Content-Type: specifies the request body type or format. This field is mandatory and its default value is application/json. Other values of this field will be provided for specific APIs if any.
- X-Auth-Token: specifies a user token only for token-based API authentication. The user token is a response to the API used to obtain a user token. This API is the only one that does not require authentication.
NOTE:
In addition to supporting token-based authentication, APIs also support authentication using access key ID/secret access key (AK/SK). During AK/SK-based authentication, an SDK is used to sign the request, and the Authorization (signature information) and X-Sdk-Date (time when the request is sent) header fields are automatically added to the request.
For more information, see AK/SK-based Authentication.
The API used to obtain a user token does not require authentication. Therefore, only the Content-Type field needs to be added to requests for calling the API. An example of such requests is as follows:
POST https://iam.ap-southeast-1.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json
Request Body
The body of a request is often sent in a structured format as specified in the Content-Type header field. The request body transfers content except the request header.
The request body varies between APIs. Some APIs do not require the request body, such as the APIs requested using the GET and DELETE methods.
In the case of the API used to obtain a user token, the request parameters and parameter description can be obtained from the API request. The following provides an example request with a body included. Set username to the name of a user, domainname to the name of the account that the user belongs to, ******** to the user's login password, and xxxxxxxxxxxxxxxxxx to the project name. You can learn more information about projects from Regions and Endpoints. Check the value of the Region column.
The scope parameter specifies where a token takes effect. You can set scope to an account or a project under an account. In the following example, the token takes effect only for the resources in a specified project. For more information about this API, see Obtaining a User Token.
POST https://iam.ap-southeast-1.myhuaweicloud.com/v3/auth/tokens Content-Type: application/json { "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "xxxxxxxxxxxxxxxxxx" } } } }
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