github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/ecs/v1/jobs/results.go (about)

     1  package jobs
     2  
     3  // Job is the structure of the API response Detail.
     4  type Job struct {
     5  	// Specifies the task status.
     6  	//   SUCCESS: indicates the task is successfully executed.
     7  	//   RUNNING: indicates that the task is in progress.
     8  	//   FAIL: indicates that the task failed.
     9  	//   INIT: indicates that the task is being initialized.
    10  	//   PENDING_PAYMENT: indicates that a yearly/monthly order is to be paid.
    11  	// NOTE:
    12  	//   The PENDING_PAYMENT status is displayed after the request for creating a yearly/monthly ECS or modifying the
    13  	//   specifications of yearly/monthly ECS has been submitted and before the order is paid. If the order is canceled,
    14  	//   the status will not be automatically updated. The task will be automatically deleted 14 days later.
    15  	Status string `json:"status"`
    16  	// Specifies the object of the task.
    17  	// The value of this parameter varies depending on the type of the task. If the task is an ECS-related operation,
    18  	// the value is server_id. If the task is a NIC operation, the value is nic_id. If a sub-Job is available, details
    19  	// about the sub-job are displayed.
    20  	Entities JobEntity `json:"entities"`
    21  	// Specifies the ID of an asynchronous request task.
    22  	ID string `json:"job_id"`
    23  	// Specifies the type of an asynchronous request task.
    24  	Type string `json:"job_type"`
    25  	// Specifies the time when the task started.
    26  	BeginTime string `json:"begin_time"`
    27  	// Specifies the time when the task finished.
    28  	EndTime string `json:"end_time"`
    29  	// Specifies the returned error code when the task execution fails.
    30  	// After the task is executed successfully, the value of this parameter is null.
    31  	ErrorCode string `json:"error_code"`
    32  	// Specifies the cause of the task execution failure.
    33  	// After the task is executed successfully, the value of this parameter is null.
    34  	FailReason string `json:"fail_reason"`
    35  	// Specifies the error message returned when an error occurs in the request to query a task.
    36  	Message string `json:"message"`
    37  	// Specifies the error code returned when an error occurs in the request to query a task.
    38  	// For details about the error code, see Returned Values for General Requests.
    39  	Code string `json:"code"`
    40  }
    41  
    42  // JobEntity is structure that shows all sub-jobs and the total count.
    43  type JobEntity struct {
    44  	// Specifies the number of subtasks.
    45  	SubJobsTotal int `json:"sub_jobs_total"`
    46  	// Specifies the execution information of a subtask.
    47  	SubJobs []SubJob `json:"sub_jobs"`
    48  }
    49  
    50  // SubJob is the structure of the execution details for each subn-job under the Job.
    51  type SubJob struct {
    52  	// Specifies the task status.
    53  	// SUCCESS: indicates the task is successfully executed.
    54  	// RUNNING: indicates that the task is in progress.
    55  	// FAIL: indicates that the task failed.
    56  	// INIT: indicates that the task is being initialized.
    57  	Status string `json:"status"`
    58  	// Specifies the object of the task. The value of this parameter varies depending on the type of the task. If the task is an ECS-related operation, the value is server_id. If the task is a NIC operation, the value is nic_id. For details, see Table 5.
    59  	Entities SubJobEntity `json:"entities"`
    60  	// Specifies the subtask ID.
    61  	ID string `json:"job_id"`
    62  	// Specify the subtask type.
    63  	Type string `json:"job_type"`
    64  	// Specifies the time when the task started.
    65  	BeginTime string `json:"begin_time"`
    66  	// Specifies the time when the task finished.
    67  	EndTime string `json:"end_time"`
    68  	// Specifies the returned error code when the task execution fails.
    69  	// After the task is executed successfully, the value of this parameter is null.
    70  	ErrorCode string `json:"error_code"`
    71  	// Specifies the cause of the task execution failure.
    72  	// After the task is executed successfully, the value of this parameter is null.
    73  	FailReason string `json:"fail_reason"`
    74  }
    75  
    76  // SubJobEntity is structure of the sub-job operation.
    77  type SubJobEntity struct {
    78  	// If the task is an ECS-related operation, the value is server_id.
    79  	ServerId string `json:"server_id"`
    80  	// If the task is a NIC-related operation, the value is nic_id.
    81  	NicId string `json:"nic_id"`
    82  	// Indicates the cause of a subtask execution failure.
    83  	ErrorcodeMessage string `json:"errorcode_message"`
    84  }