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

     1  package job
     2  
     3  type CreateResponse struct {
     4  	Name             string             `json:"name"`
     5  	ValidationResult []ValidationDetail `json:"validation-result"`
     6  }
     7  
     8  type ValidationDetail struct {
     9  	Message string `json:"message"`
    10  	// ERROR,WARNING
    11  	Status string `json:"status"`
    12  }
    13  
    14  type validationResult struct {
    15  	LinkConfig []ValidationDetail `json:"linkConfig"`
    16  }
    17  
    18  type JobsDetail struct {
    19  	Total    int   `json:"total"`
    20  	Jobs     []Job `json:"jobs"`
    21  	PageNo   int   `json:"page_no"`
    22  	PageSize int   `json:"page_size"`
    23  	// Whether to return compact information. If this parameter is set to true, compact information will be returned,
    24  	// which means only parameter names and values will be returned.
    25  	// Attributes such as size, type, and id will not be returned.
    26  	Simple bool `json:"simple"`
    27  }
    28  
    29  type UpdateResponse struct {
    30  	ValidationResult []validationResult `json:"validation-result"`
    31  }
    32  
    33  type ErrorResponse struct {
    34  	// Error code
    35  	ErrCode string `json:"errCode"`
    36  	// Error message
    37  	ErrMessage string `json:"externalMessage"`
    38  }
    39  
    40  type StartJobResponse struct {
    41  	Submissions []JobSubmission `json:"submissions"`
    42  }
    43  
    44  type JobSubmission struct {
    45  	DeleteRows   int    `json:"delete_rows"`
    46  	UpdateRows   int    `json:"update_rows"`
    47  	WriteRows    int    `json:"write_rows"`
    48  	SubmissionId int    `json:"submission-id"`
    49  	JobName      string `json:"job-name"`
    50  	CreationUser string `json:"creation-user"`
    51  	CreationDate int    `json:"creation-date"`
    52  	// Job progress. If a job fails, the value is -1. Otherwise, the value ranges from 0 to 100.
    53  	Progress float32 `json:"progress"`
    54  	// Job status. The options are as follows:
    55  	// BOOTING: The job is starting.
    56  	// FAILURE_ON_SUBMIT: The job fails to be submitted.
    57  	// RUNNING: The job is running.
    58  	// SUCCEEDED: The job is executed successfully.
    59  	// FAILED: The job failed.
    60  	// UNKNOWN: The job status is unknown.
    61  	// NEVER_EXECUTED: The job has not been executed.
    62  	Status             string `json:"status"`
    63  	IsStopingIncrement string `json:"isStopingIncrement"`
    64  	IsExecuteAuto      bool   `json:"is-execute-auto"`
    65  	// Whether the job involves incremental data migration
    66  	IsIncrementing bool `json:"isIncrementing"`
    67  
    68  	LastUpdateDate int    `json:"last-update-date"`
    69  	LastUdpateUser string `json:"last-udpate-user"`
    70  	// Whether to delete the job after it is executed
    71  	IsDeleteJob bool `json:"isDeleteJob"`
    72  }
    73  
    74  type StatusResponse struct {
    75  	Submissions []StatusSubmission `json:"submissions"`
    76  }
    77  
    78  type StatusSubmission struct {
    79  	JobSubmission
    80  
    81  	// Job running result statistics. This parameter is available only when status is SUCCEEDED.
    82  	Counters     Counters `json:"counters"`
    83  	ExternalId   string   `json:"external-id"`
    84  	ExecuteDate  int      `json:"execute-date"`
    85  	ErrorDetails string   `json:"error-details"`
    86  	ErrorSummary string   `json:"error-summary"`
    87  }
    88  
    89  type Counters struct {
    90  	SqoopCounters Counter `json:"org.apache.sqoop.submission.counter.SqoopCounters"`
    91  }
    92  
    93  type Counter struct {
    94  	BytesWritten       int `json:"BYTES_WRITTEN"`
    95  	TotalFiles         int `json:"TOTAL_FILES"`
    96  	RowsRead           int `json:"ROWS_READ"`
    97  	BytesRead          int `json:"BYTES_READ"`
    98  	RowsWritten        int `json:"ROWS_WRITTEN"`
    99  	FilesWritten       int `json:"FILES_WRITTEN"`
   100  	FilesRead          int `json:"FILES_READ"`
   101  	TotalSize          int `json:"TOTAL_SIZE"`
   102  	FilesSkipped       int `json:"FILES_SKIPPED"`
   103  	RowsWrittenSkipped int `json:"ROWS_WRITTEN_SKIPPED"`
   104  }
   105  
   106  type ListSubmissionsRst struct {
   107  	Submissions []StatusSubmission `json:"submissions"`
   108  	Total       int                `json:"total"`
   109  	PageNo      int                `json:"page_no"`
   110  	PageSize    int                `json:"page_size"`
   111  }