Creating a Report Template
Function
This API is used to create a report template.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/report-profile
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details, see Obtaining a Project ID. Constraints N/A Range 32-bit UUID. Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
fw_instance_id |
Yes |
String |
Definition Firewall ID. It is a unique ID generated after a firewall instance is created. You can obtain the firewall ID by referring to Obtaining a Firewall ID. Constraints N/A Range 32-bit UUID. Default Value N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
category |
Yes |
String |
Definition Report type. Constraints N/A Range daily: daily report weekly: weekly report custom: custom report Default Value N/A |
description |
No |
String |
Definition Description. Constraints N/A Range N/A Default Value N/A |
name |
Yes |
String |
Definition Template name. Constraints N/A Range N/A Default Value N/A |
send_period |
No |
Integer |
Definition Sending time. This parameter is mandatory for daily and weekly reports. Constraints N/A Range N/A Default Value N/A |
send_week_day |
No |
Integer |
Definition Days in a week when data is sent. This parameter is mandatory for weekly reports. Constraints N/A Range N/A Default Value N/A |
statistic_period |
No |
StatisticPeriod object |
Definition Statistical period, which needs to be set for custom reports. Constraints N/A Range N/A Default Value N/A |
status |
No |
Integer |
Definition Enabling status. Constraints N/A Range 0: disabled 1: enabled Default Value N/A |
topic_urn |
Yes |
String |
Definition Notification group. Constraints N/A Range N/A Default Value N/A |
subscription_type |
No |
Integer |
Definition Notification method. Constraints N/A Range 0: SMN notification 1: no notification Default Value N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
data |
data object |
Definition Response information. Range N/A |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Definition Template ID. Range N/A |
name |
String |
Definition Template name. Range N/A |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Definition Error code. Range N/A |
error_msg |
String |
Definition Error message. Range N/A |
Example Requests
Create a report template. The project ID is eb7accd78ea845078275b2ad5280a109, the firewall ID is 8a996d43-75bd-48b4-b1b8-de0706b72b8f, the template name is test, the report type is daily, the topic name is test, the URN is urn:smn:cn-north-4:eb7accd78ea845078275b2ad5280a109:test, and the sending time is 00:00 every day.
https://{Endpoint}/v1/eb7accd78ea845078275b2ad5280a109/report-profile?fw_instance_id=8a996d43-75bd-48b4-b1b8-de0706b72b8f { "name" : "test", "category" : "daily", "topic_urn" : "urn:smn:cn-north-4:eb7accd78ea845078275b2ad5280a109:test", "send_period" : 0 }
Example Responses
Status code: 200
OK
{ "data" : { "id" : "f9116386-4ef9-40b5-bc2e-bdd7c17b3650", "name" : "fgsd" } }
Status code: 400
Bad Request
{ "error_code" : "CFW.00200003", "error_msg" : "Parameter error." }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
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