Creating a System Subscription Event
Function
This API is used to create a system subscription event.
URI
POST /v2/{project_id}/routemgr/exchanger/systemevents
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
ief-instance-id |
No |
String |
Platinum edition instance ID. This parameter is left blank for a professional edition instance. |
Content-Type |
Yes |
String |
Message body type (format). The default value is application/json. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
systemevent |
No |
EventCreateDetail object |
Basic information of the system subscription event. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
System subscription event name. The value can contain a maximum of 64 characters, including lowercase letters, digits, underscores (_), and hyphens (-). Names of system subscription events and message rules created under the same account must be unique. |
description |
No |
String |
Description. The maximum length is 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\ |
events |
No |
String |
System subscription event topic. Each topic consists of edge resource/operation. Multiple topics are separated by commas (,). The following topics are supported:
|
target |
No |
String |
Destination endpoint ID. |
target_resource |
No |
EndpointResource object |
Destination endpoint resource. |
Response
Status code: 201
Parameter |
Type |
Description |
---|---|---|
systemevent |
Event object |
Details of the system subscription events. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
System subscription event ID. |
name |
String |
System subscription event name. The value can contain a maximum of 64 characters, including lowercase letters, digits, underscores (_), and hyphens (-). Names of system subscription events and message rules created under the same account must be unique. |
project_id |
String |
ID of the project to which the system subscription event belongs. |
created_at |
String |
Creation time. |
updated_at |
String |
Update time. |
description |
String |
Description. The value can contain a maximum of 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\ |
in_using |
Boolean |
Whether the system subscription rule is enabled. The default value is true, indicating that the rule is enabled. |
events |
String |
System subscription event topic. Each topic consists of edge resource/operation. Multiple topics are separated by commas (,). The following topics are supported:
|
target |
EndpointObjResp object |
Destination endpoint. |
target_resource |
Map<String,String> |
Destination endpoint's resource attribute. |
success_messages |
Integer |
Successful requests. |
fail_messages |
Integer |
Failed requests. |
delete_at |
Integer |
Deletion time. |
Parameter |
Type |
Description |
---|---|---|
created_at |
String |
Creation time. |
description |
String |
Endpoint description. The value can contain a maximum of 255 characters. The following characters are not allowed: ^~#$%&*<>()[]{}'"\ |
id |
String |
Endpoint ID. |
ief_instance_id |
String |
Platinum edition instance ID. This parameter is left blank for a professional edition instance. |
is_shared |
Boolean |
Whether the endpoint is shared. |
name |
String |
Endpoint name. The value can contain a maximum of 64 characters, including letters, digits, underscores (_), and hyphens (-). Endpoint names created under the same account must be unique. |
project_id |
String |
Project ID. |
properties |
Map<String,Object> |
Endpoint properties to be displayed. Example:
|
type |
String |
Endpoint type. The options are as follows:
|
updated_at |
String |
Update time. |
Example Request
A system subscription event with the node online topic is created.
{ "systemevent" : { "name" : "aa", "description" : "", "events" : "edgeNode/online", "target_resource" : { "resource" : "https://www.fake.com" }, "target" : "591ba510-8c62-41b8-a0c3-d94262ef97ef" } }
Example Response
Status code: 201
Creation succeeded.
{ "systemevent" : { "id" : "b79f4d8e-4549-4da4-9a9c-a9d13452c7d6", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-11-02T07:17:01.372735871Z", "updated_at" : "2022-11-02T07:17:01.372735998Z", "name" : "aa", "description" : "", "in_using" : true, "events" : "edgeNode/online", "target" : { "name" : "apigw", "description" : "", "type" : "apigw", "properties" : { "domain_id" : "d0857ebddc514a7381c3673363e61337" }, "ief_instance_id" : "38898a99-d67c-41f8-a8cb-8c53d6d297ba", "is_shared" : false, "id" : "591ba510-8c62-41b8-a0c3-d94262ef97ef", "project_id" : "ed202955e111444e8ced21a1bd75fc59", "created_at" : "2022-06-02T11:15:26.29972+08:00", "updated_at" : "2022-06-02T11:15:26.29972+08:00" }, "target_resource" : { "resource" : "https://www.fake.com" }, "fail_messages" : 0, "success_messages" : 0, "delete_at" : 0 } }
Status Codes
Status Code |
Description |
---|---|
201 |
Creation succeeded. |
Error Codes
For details, 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