Creates a diagnostic report for a resource. When you call this operation, you can set MetricSetId to generate a diagnostic report based on the specified diagnostic metric set. Then, you can call the DescribeDiagnosticReportAttributes operation based on the returned diagnostic report ID to view the details of the diagnostic report.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateDiagnosticReport | The operation that you want to perform. Set the value to CreateDiagnosticReport. |
RegionId | String | Yes | cn-hangzhou | The region ID of the resource. You can call the DescribeRegions operation to query the most recent region list. |
ResourceId | String | Yes | i-uf6i0tv2refv8wz***** | The resource ID. |
MetricSetId | String | No | dms-uf6i0tv2refv8wz***** | The ID of the diagnostic metric set. If this parameter is left empty, the dms-instancedefault set is used, which is the default diagnostic metric set provided for Elastic Compute Service (ECS) instances. |
StartTime | String | No | 2022-07-11T12:00Z | The beginning of the reporting period. This parameter takes effect only for diagnostic metrics that do not need to be assessed by running Cloud Assistant commands in guest operating systems. |
EndTime | String | No | 2022-07-11T14:00Z | The end of the reporting period. This parameter takes effect only for diagnostic metrics that do not need to be assessed by running Cloud Assistant commands in guest operating systems. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE***** | The request ID. |
ReportId | String | dr-uf6i0tv2refv8wz***** | The ID of the diagnostic report, which is the unique identifier of the report. |
Examples
Sample requests
http(s)://ecs.aliyuncs.com/?Action=CreateDiagnosticReport
&RegionId=cn-hangzhou
&ResourceId=i-uf6i0tv2refv8wz*****
&MetricSetId=dms-uf6i0tv2refv8wz*****
&StartTime=2022-07-11T12:00Z
&EndTime=2022-07-11T14:00Z
Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDiagnosticReportResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE*****</RequestId>
<ReportId>dr-uf6i0tv2refv8wz*****</ReportId>
</CreateDiagnosticReportResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE*****",
"ReportId" : "dr-uf6i0tv2refv8wz*****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter | %s | Invalid parameter value. |
For a list of error codes, visit the API Error Center.