job

package
v0.0.0-...-1fd1e9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobEntity

type JobEntity struct {
	// Specifies the number of subtasks.
	// When no subtask exists, the value of this parameter is 0.
	SubJobsTotal int `json:"sub_jobs_total"`

	// Specifies the execution information of a subtask.
	// When no subtask exists, the value of this parameter is left blank.
	SubJobs []SubJob `json:"sub_jobs"`
}

type JobExecResult

type JobExecResult struct {
	// contains filtered or unexported fields
}

JobExecResult represents the result of a get operation. Call its ExtractJobResult method to interpret it as a jobresult.

func (JobExecResult) ExtractJobResult

func (r JobExecResult) ExtractJobResult() (JobResult, error)

ExtractJobResult is a function that accepts a result and extracts a jobresult.

type JobResult

type JobResult struct {
	// Specifies the task ID.
	Id string `json:"job_id"`

	// Specifies the task type.
	Type string `json:"job_type"`

	//Specifies the task status.
	//  SUCCESS: indicates the task is successfully executed.
	//  RUNNING: indicates that the task is in progress.
	//  FAIL: indicates that the task failed.
	//  INIT: indicates that the task is being initialized.
	Status string `json:"status"`

	// Specifies the time when the task started.
	BeginTime string `json:"begin_time"`

	// Specifies the time when the task finished.
	EndTime string `json:"end_time"`

	// Specifies the returned error code when the task execution fails.
	ErrorCode string `json:"error_code"`

	// Specifies the cause of the task execution failure.
	FailReason string `json:"fail_reason"`

	// Specifies the object of the task.
	Entities JobEntity `json:"entities"`
}

func GetJobResult

func GetJobResult(client *gophercloud.ServiceClient, id string) (JobResult, error)

Querying the task status based on its job ID.

type SubJob

type SubJob struct {
	// Specifies the task ID.
	Id string `json:"job_id"`

	// Task type.
	Type string `json:"job_type"`

	//Specifies the task status.
	//  SUCCESS: indicates the task is successfully executed.
	//  RUNNING: indicates that the task is in progress.
	//  FAIL: indicates that the task failed.
	//  INIT: indicates that the task is being initialized.
	Status string `json:"status"`

	// Specifies the time when the task started.
	BeginTime string `json:"begin_time"`

	// Specifies the time when the task finished.
	EndTime string `json:"end_time"`

	// Specifies the returned error code when the task execution fails.
	ErrorCode string `json:"error_code"`

	// Specifies the cause of the task execution failure.
	FailReason string `json:"fail_reason"`

	// Specifies the object of the task.
	Entities *SubJobEntity `json:"entities"`
}

type SubJobEntity

type SubJobEntity struct {
	// If the task is an ECS-related operation, the value is server_id.
	ServerId string `json:"server_id"`

	// If the task is a NIC-related operation, the value is nic_id.
	NicId string `json:"nic_id"`
}

Directories

Path Synopsis
job unit tests
job unit tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL