Creating a Custom Event Schema
Function
This API is used to create a custom event schema.
URI
POST /v1/{project_id}/schemas
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Tenant project ID. |
Request Parameters
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. Minimum: 1 Maximum: 16384 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Name of the event schema. The value must be unique under a tenant. Only letters, digits, periods (.), underscores (_), and hyphens (-) are allowed. It must start with a letter or digit. Minimum: 1 Maximum: 128 |
description |
No |
String |
Description of the event schema. Maximum: 255 |
compatibility |
Yes |
String |
Compatibility of the event schema. Enumeration values:
|
format |
No |
String |
Schema content format. Default: JSON_SCHEMA_DRAFT_6 Enumeration values:
|
data_sample |
No |
String |
Example event. Maximum: 1024 |
definition |
Yes |
String |
Event schema content definition. Maximum: 2048 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
X-Request-Id |
String |
This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
ID of the event schema. |
name |
String |
Name of the event schema. The value must be unique under a tenant. |
description |
String |
Description of the event schema. |
compatibility |
String |
Compatibility of the event schema. Enumeration values:
|
provider_type |
String |
Type of the event source provider, which can be OFFICIAL (official event source) or CUSTOM (custom event source). Enumeration values:
|
format |
String |
Format of the event schema. |
number_of_versions |
Integer |
Number of event schema versions. |
created_time |
String |
Time when the event schema is created. |
updated_time |
String |
Time when the event schema is updated. |
data_sample |
String |
Example event. |
version |
Integer |
Current version number of the event schema. |
definition |
String |
Event schema content definition. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 1 Maximum: 128 |
error_msg |
String |
Error message. Minimum: 1 Maximum: 512 |
error_details |
String |
Error details. Minimum: 1 Maximum: 1024 |
request_id |
String |
Request ID. Minimum: 1 Maximum: 128 |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 1 Maximum: 128 |
error_msg |
String |
Error message. Minimum: 1 Maximum: 512 |
error_details |
String |
Error details. Minimum: 1 Maximum: 1024 |
request_id |
String |
Request ID. Minimum: 1 Maximum: 128 |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 1 Maximum: 128 |
error_msg |
String |
Error message. Minimum: 1 Maximum: 512 |
error_details |
String |
Error details. Minimum: 1 Maximum: 1024 |
request_id |
String |
Request ID. Minimum: 1 Maximum: 128 |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 1 Maximum: 128 |
error_msg |
String |
Error message. Minimum: 1 Maximum: 512 |
error_details |
String |
Error details. Minimum: 1 Maximum: 1024 |
request_id |
String |
Request ID. Minimum: 1 Maximum: 128 |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 1 Maximum: 128 |
error_msg |
String |
Error message. Minimum: 1 Maximum: 512 |
error_details |
String |
Error details. Minimum: 1 Maximum: 1024 |
request_id |
String |
Request ID. Minimum: 1 Maximum: 128 |
Example Requests
Create a schema.
/v1/{project_id}/schemas { "name" : "name", "description" : "aaa", "compatibility" : "BACKWARD", "definition" : "aaa" }
Example Responses
Status code: 400
{ "error_code" : "EG.00014000", "error_msg" : "Bad request" }
Status code: 401
{ "error_code" : "EG.00014010", "error_msg" : "Incorrect token or token resolution failed" }
Status code: 403
{ "error_code" : "EG.00014030", "error_msg" : "No permissions to request this method" }
Status code: 404
{ "error_code" : "EG.00014040", "error_msg" : "Not request resource found" }
Status code: 500
{ "error_code" : "EG.00015000", "error_msg" : "Internal Server Error" }
Status Codes
Status Code |
Description |
---|---|
200 |
Demo Information |
400 |
Invalid request. |
401 |
Unauthorized. |
403 |
Access denied. |
404 |
Resource not found. |
500 |
Internal service 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.