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 |
Details: Start time in the format of "YYYY-MM-DD". Constraints: The time range cannot exceed 30 days. Value Range: The value matches the regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
end_time |
Yes |
String |
Details: Start time in the format of "YYYY-MM-DD". Constraints: The time range cannot exceed 30 days. Value Range: The value matches the regular expression ^[0-9]{4}-[0-9]{2}-[0-9]{2}$. |
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 is obtained by calling the IAM API. 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. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
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 |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
Internal Server 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.