Querying Build Success Rate in a Specified Period
Function
This API is used to query the success rate of a build task in a specified period.
Calling Method
For details, see Calling APIs.
URI
GET /v3/jobs/{job_id}/success-ratio
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
job_id |
Yes |
String |
Definition Enter the ID of the build task whose history you want to query. To obtain this ID, open the build task details page in your browser, and copy the 32-character string, which includes both digits and letters, at the end of the URL. Constraints N/A. Range The value is 32 characters long. Only letters and digits are allowed. Default Value N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
start_time |
Yes |
String |
Definition Start time. Constraints The time range cannot exceed 30 days. Range The value is in the format of yyyy-MM-dd. |
|
end_time |
Yes |
String |
Definition End time in the format of yyyy-MM-dd. Constraints The time range cannot exceed 30 days. Range The value is in the format of yyyy-MM-dd. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. (The value of the X-Subject-Token response header is the user token.) It can be obtained by calling the IAM service API. For details, seeObtaining an IAM User Token. Constraints Global tenant tokens are not supported. Use a region-level token whose scope is project. Range N/A. Default Value N/A. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
success_count |
Integer |
Definition Number of successful builds. Range 0–2147483647 |
|
total_count |
Integer |
Definition Total number of builds. Range 0–2147483647 |
|
success_ratio |
Double |
Definition Task success rate, accurate to two decimal places. Range N/A. |
Example Requests
GET https://{endpoint}/v3/jobs/{job_id}/success-ratio?start_time=2021-12-01&end_time=2021-12-01
Example Responses
Status code: 200
OK
{
"success_count" : 2,
"total_count" : 3,
"success_ratio" : 0.67
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
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.