Domain name for API request: tdmq.tencentcloudapi.com.
This API is used to create a TDMQ namespace.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CreateEnvironment. |
Version | Yes | String | Common Params. The value used for this API: 2020-02-17. |
Region | No | String | Common Params. This parameter is not required for this API. |
EnvironmentId | Yes | String | Environment (namespace) name, which can contain up to 16 letters, digits, hyphens, and underscores. |
MsgTTL | Yes | Integer | Retention period for unconsumed messages in seconds. Value range: 60s to 1,296,000s (or 15 days). |
Remark | No | String | Remarks (up to 128 characters). |
ClusterId | No | String | Pulsar cluster ID |
RetentionPolicy | No | RetentionPolicy | Message retention policy |
AutoSubscriptionCreation | No | Boolean | Whether to enable "Auto-Create Subscription" |
Parameter Name | Type | Description |
---|---|---|
EnvironmentId | String | Environment (namespace) name. |
MsgTTL | Integer | TTL for unconsumed messages in seconds. |
Remark | String | Remarks (up to 128 characters). Note: this field may return null, indicating that no valid values can be obtained. |
NamespaceId | String | Namespace ID |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to create a namespace. You can enable "Auto-Create Subscription" as needed when creating the namespace.
POST / HTTP/1.1
Host: tdmq.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateEnvironment
<Common request parameters>
{
"EnvironmentId": "test1",
"MsgTTL": "100",
"AutoSubscriptionCreation": true,
"ClusterId": "pulsar-xxxxxxxx"
}
{
"Response": {
"EnvironmentId": "test1",
"NamespaceId": "namespace-8893gp3428",
"MsgTTL": 100,
"Remark": "",
"RequestId": "0843ea4f-d6ba-463b-952c-75708a7e8901"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
AuthFailure.UnauthorizedOperation | CAM authentication failed. |
FailedOperation | Operation failed. |
FailedOperation.CreateEnvironment | Failed to create the environment. |
FailedOperation.CreateNamespace | Failed to create the namespace. |
InternalError.SystemError | System error. |
InvalidParameterValue.InvalidParams | The parameter value is out of the value range. |
InvalidParameterValue.TTL | The message TTL value is invalid. |
LimitExceeded.Environments | The number of environments under the instance exceeds the limit. |
LimitExceeded.Namespaces | The number of namespaces under the instance exceeds the limit. |
LimitExceeded.RetentionSize | The remaining quota has been exceeded. Please enter a valid value. |
LimitExceeded.RetentionTime | The message retention period limit has been exceeded. Please enter a valid value. |
MissingParameter.NeedMoreParams | A required parameter is missing. |
OperationDenied.DefaultEnvironment | Operations on the default environment are not allowed. |
ResourceInUse | The resource is in use. |
ResourceInUse.Namespace | A namespace with the same name already exists. |
ResourceNotFound.Cluster | The cluster does not exist. |
Was this page helpful?