Obtaining Scheduled Tasks
Function
This API is used to obtain the scheduled tasks. Before calling this API:
- Learn how to authorize and authenticate it.
- Obtain the required region and endpoint.
URI
GET /v3/{project_id}/scheduled-jobs
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
String |
Index offset. The query starts from the first piece of data. The default value is 0. The value must be a number and cannot be a negative number. |
limit |
No |
String |
Number of records to be queried. The default value is 10. |
status |
No |
String |
Task execution status. Value:
|
start_time |
No |
String |
Start time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.
NOTE:
The value is empty when the DB instance is being created. After the DB instance is created, the value is not empty. |
end_time |
No |
String |
End time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.
NOTE:
The value is empty when the DB instance is being created. After the DB instance is created, the value is not empty. |
job_id |
No |
String |
Task ID. |
job_name |
No |
String |
Task scheduling type. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. If the following response body is returned for calling the API used to obtain a user token, the request is successful. After the request is processed, the value of X-Subject-Token in the message header is the token value. |
X-Language |
No |
String |
Request language type. The default value is en-us. Value:
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
schedules |
Array of ScheduleTask objects |
Task details. |
total_count |
Integer |
Total number of records. |
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
Task ID. |
instance_id |
String |
Instance ID. |
instance_name |
String |
Instance name. |
instance_status |
String |
Instance status. Value:
|
project_id |
String |
Project ID of a tenant in a region. |
job_name |
String |
Task name. Value:
|
create_time |
String |
Task creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.
NOTE:
The value is empty when the DB instance is being created. After the DB instance is created, the value is not empty. |
start_time |
String |
Task start time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.
NOTE:
The value is empty when the DB instance is being created. After the DB instance is created, the value is not empty. |
end_time |
String |
Task end time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.
NOTE:
The value is empty when the DB instance is being created. After the DB instance is created, the value is not empty. |
job_status |
String |
Task execution status. Value:
|
datastore_type |
String |
Database type. |
target_config |
Object |
Instance configuration information, such as specifications. |
Status code: 400
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 Request
Obtaining scheduled tasks
GET https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/scheduled-jobs?offset=1&limit=10
Example Response
Status code: 200
Success.
{ "schedules" : [ { "job_id" : "56d3c1138dcf4f1da73b0170700c78d0", "instance_id" : "79bc540dd4d6432784894a981fdfacfcin07", "instance_name" : "gauss-f821", "instance_status" : "BUILD", "project_id" : "053f533ead80d5102f0cc012e8d468a4", "job_name" : "UpgradeGaussDBforMySQLDatabaseVersion", "create_time" : "2018-08-06T10:41:14+0000", "start_time" : "2018-08-06T10:41:14+0000", "end_time" : "2018-08-06T10:41:14+0000", "job_status" : "Completed", "datastore_type" : "gaussdb-mysql", "target_config" : { "flavor" : "gaussdb.mysql.xlarge.arm.4", "mem" : "16", "cpu" : "4" } } ], "total_count" : 1 }
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.