Add Domain Configurations
Function
This API is used by an application to add a domain configuration (one at most) to the platform.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
iotda:domainconfiguration:create
Write
instance *
-
g:EnterpriseProjectId
-
g:ResourceTag/<tag-key>
-
-
-
URI
POST /v5/iot/{project_id}/domain-configurations
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Parameter description: project ID. For details, see Obtaining a Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Instance-Id |
No |
String |
Parameter description: instance ID. Unique identifier of each instance in the physical multi-tenant scenario. Mandatory for professional editions and recommended in other cases. Log in to the IoTDA console and choose Overview in the navigation pane to view the instance ID. For details, see Viewing Instance Details. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
domain_name |
Yes |
String |
Parameter description: custom domain name. Value: valid domain name format, which must meet the regular expression: [a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?. |
|
access_protocol |
Yes |
String |
Parameter description: access protocol. Currently, only MQTTS device access is supported. Value: Currently, only Device-MQTTS is supported. |
|
server_certificate_id |
Yes |
String |
Parameter description: ID of the custom server certificate. Value: The value can contain up to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
|
server_certificate_config |
No |
ServerCertificateConfig object |
Parameter description: server certificate configuration. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
ocsp_stapling_enable |
No |
Boolean |
Description: whether to enable OCSP stapling on the server. Value: true (enabled) or false (disabled). The default value is false. |
|
ocsp_server_ca_id |
No |
String |
Description: ID of the CA certificate on the OCSP server. This parameter can be configured only when the OCSP server uses HTTPS. Value: The value can contain up to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
|
ocsp_ssl_enable |
No |
Boolean |
Description: whether to enable SSL for accessing the OCSP server. Value: true (enabled) or false (disabled). The default value is true. |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
configuration_id |
String |
Unique ID of the domain configuration. |
|
domain_name |
String |
Parameter description: custom domain name. |
|
access_protocol |
String |
Parameter description: application protocol scenario. Currently, only MQTTS device access is supported. |
|
server_certificate_id |
String |
Parameter description: custom server certificate ID. |
|
server_certificate_config |
ServerCertificateConfig object |
Parameter description: server certificate configuration. |
|
Parameter |
Type |
Description |
|---|---|---|
|
ocsp_stapling_enable |
Boolean |
Description: whether to enable OCSP stapling on the server. Value: true (enabled) or false (disabled). The default value is false. |
|
ocsp_server_ca_id |
String |
Description: ID of the CA certificate on the OCSP server. This parameter can be configured only when the OCSP server uses HTTPS. Value: The value can contain up to 36 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
|
ocsp_ssl_enable |
Boolean |
Description: whether to enable SSL for accessing the OCSP server. Value: true (enabled) or false (disabled). The default value is true. |
Example Requests
Adds domain configurations.
POST https://{endpoint}/v5/iot/{project_id}/domain-configurations
{
"domain_name" : "iotda-device.cn-north-4.myhuaweicloud.com",
"access_protocol" : "Device-MQTTS",
"server_certificate_id" : "5c90fa7d3c4e4405e8525079",
"server_certificate_config" : {
"ocsp_stapling_enable" : false,
"ocsp_server_ca_id" : "5c90fa7d3c4e4405e8525079",
"ocsp_ssl_enable" : true
}
}
Example Responses
Status code: 201
Created
{
"configuration_id" : "5c90fa7d3c4e4405e8525079",
"domain_name" : "iotda-device.cn-north-4.myhuaweicloud.com",
"access_protocol" : "Device-MQTTS",
"server_certificate_id" : "5c90fa7d3c4e4405e8525079",
"server_certificate_config" : {
"ocsp_stapling_enable" : false,
"ocsp_server_ca_id" : "5c90fa7d3c4e4405e8525079",
"ocsp_ssl_enable" : true
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Created |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
400 |
Bad Request |
|
500 |
Internal Server Error |
Error Codes
See Error Codes.
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