Querying Details About a Rule
Description
This API is used to obtain details about a rule.
URI
GET /v2/{project_id}/routemgr/rules/{rule_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| rule_id | Yes | String | Rule ID. |
Request Parameters
None
Response Parameters
If a status code 200 is returned:
| Parameter | Type | Description |
|---|---|---|
| rule | RuleResponse object | Rule details. |
| Parameter | Type | Description |
|---|---|---|
| created_at | String | Time when the rule is created. |
| description | String | Rule description. The value contains a maximum of 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\ |
| fail_messages | Integer | Number of messages that fail to be forwarded. |
| id | String | Rule ID. |
| ief_instance_id | String | ID of a platinum service instance. If this parameter is left blank, the service instance is a professional service instance. |
| in_using | Boolean | Whether to enable the rule. The default value is true, indicating that the rule is enabled. |
| name | String | Rule name. The value contains a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. The rule name must be unique under an account. |
| project_id | String | Project ID. |
| source | EndpointResponse object | Source endpoint information. |
| source_resource | Object | Source endpoint resource. Example:
{"path":"<standard uri format>"}
{"topic": "<project id>/nodes/<node id>/user/<topic>","node_id":"<node id>"} |
| success_messages | Integer | Number of messages that are successfully forwarded. |
| target | EndpointResponse object | Destination endpoint information. |
| target_resource | Object | Destination endpoint resource. Example:
{"domain_id":"user's domain id"}
{"service_port":8080}
{"domain_id":"user's domain id"} |
| updated_at | String | Time when the rule is updated. |
| Parameter | Type | Description |
|---|---|---|
| created_at | String | Time when the endpoint is created. |
| description | String | Endpoint description. The value contains a maximum of 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\ |
| id | String | Endpoint ID. |
| ief_instance_id | String | ID of a platinum service instance. If this parameter is left blank, the service instance is a professional service instance. |
| is_shared | Boolean | Whether the endpoint is shared. |
| name | String | Endpoint name. The value contains a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. The endpoint name must be unique under an account. |
| project_id | String | Project ID. |
| properties | Object | Endpoint properties, which need to be displayed externally. Example:
{"domain id":"user's domain id"}
{"service port":8080}
{"domain id":"user's domain id"} |
| type | String | Endpoint type. Enumeration values:
|
| updated_at | String | Time when the endpoint is updated. |
If a status code 401 is returned:
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_message | String | Error description. |
If a status code 404 is returned:
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_message | String | Error description. |
If a status code 500 is returned:
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_message | String | Error description. |
Request Examples
None
Response Examples
If a status code 200 is returned:
{
"rule" : {
"name" : "haha",
"description" : "",
"source_resource" : {
"topic" : "d16e6eb6cc0d49a0941df2f31285757a/device/c978f393-d80a-4aa0-b182-ec8ae879bab8/messages/#"
},
"target_resource" : {
"channel" : "AAA"
},
"in_using" : true,
"id" : "8a866e38-1f39-47a8-a831-88f2e48051e9",
"project_id" : "d16e6eb6cc0d49a0941df2f31285757a",
"created_at" : "2018-11-26T03:35:20Z",
"updated_at" : "2018-11-26T03:35:20Z",
"source" : {
"name" : "SystemMQTT",
"description" : "",
"type" : "mqtt",
"properties" : {
"public" : "10.154.72.82:8883"
},
"is_shared" : true,
"id" : "88626dd0-0616-47c0-9980-e702e0fb8f7c",
"project_id" : "e632aba927ea4ac2b575ec1603d56f10",
"created_at" : "2018-11-26T00:52:46Z",
"updated_at" : "2018-11-26T00:52:46Z"
},
"target" : {
"name" : "dis_example",
"description" : "",
"type" : "dis",
"properties" : {
"domain_id" : "8fd3691d01f44badab03e28d81abd4ff"
},
"is_shared" : false,
"id" : "e7d02d47-961d-4e65-9f15-856272983ca9",
"project_id" : "d16e6eb6cc0d49a0941df2f31285757a",
"created_at" : "2018-11-26T01:07:18Z",
"updated_at" : "2018-11-26T01:07:18Z"
},
"fail_messages" : 0,
"success_messages" : 0
}
} If a status code 401 is returned:
{
"error_code" : "IEF.310001",
"error_message" : "XXXXXXXXXX"
} If a status code 404 is returned:
{
"error_code" : "IEF.310001",
"error_message" : "XXXXXXXXXX"
} If a status code 500 is returned:
{
"error_code" : "IEF.310001",
"error_message" : "XXXXXXXXXX"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The rule information is successfully queried. |
| 401 | Error response. |
| 404 | Error response. |
| 500 | Error response. |
Error Codes
See Error Codes.
Last Article: Creating a Rule
Next Article: Deleting a Rule
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.