API | Description |
Submits a multi-file zipping job. | |
Queries the result of a specified multi-file zipping job. |
func (s *CIService) CreateFileProcessJob(ctx context.Context, opt *FileProcessJobOptions) (*FileProcessJobResult, *Response, error)
createJobOpt := &cos.FileProcessJobOptions{Tag: "FileCompress",Operation: &cos.FileProcessJobOperation{FileCompressConfig: &cos.FileCompressConfig{Format: "zip",Flatten: "0",Key: []string{"1.mp3", "2.jpg"},},Output: &cos.FileProcessOutput{Region: "ap-shanghai",Bucket: "test-1250000000",Object: "vvvvxxxzz.zip",},},QueueId: "p111a8dd208104ce3b11c78398f658ca8",}res, _, err := c.CI.CreateFileProcessJob(context.Background(), createJobOpt)
type FileProcessJobOptions struct {XMLName xml.NameTag stringInput *FileProcessInputOperation *FileProcessJobOperationQueueId stringCallBackFormat stringCallBackType stringCallBack stringCallBackMqConfig *NotifyConfigCallBackMqConfig}type FileProcessInput struct {Region stringBucket stringObject string}type FileProcessJobOperation struct {FileHashCodeConfig *FileHashCodeConfigFileHashCodeResult *FileHashCodeResultFileUncompressConfig *FileUncompressConfigFileUncompressResult *FileUncompressResultFileCompressConfig *FileCompressConfigFileCompressResult *FileCompressResultOutput *FileProcessOutputUserData string}type FileHashCodeConfig struct {Type stringAddToHeader bool}type FileHashCodeResult struct {MD5 stringSHA1 stringSHA256 stringFileSize intLastModified stringEtag string}type FileUncompressConfig struct {Prefix stringPrefixReplaced string}type FileUncompressResult struct {Region stringBucket stringFileCount string}type FileCompressConfig struct {Flatten stringFormat stringUrlList stringPrefix stringKey []string}type FileCompressResult struct {Region stringBucket stringObject string}type FileProcessOutput struct {Region stringBucket stringObject string}type NotifyConfigCallBackMqConfig struct {MqMode stringMqRegion stringMqName string}
Parameter | Description | Type | Required |
Tag | Job tag, which currently can only be FileCompress . | String | Yes |
Input | Container | Yes | |
Operation | Operation rule | Container | Yes |
Operation.FileCompressConfig | Container | Yes | |
Operation.FileCompressResult | Multi-file zipping result, which will not be returned when the job is not completed. For more information, see Submitting Multi-File Zipping Job. | Container | No |
Operation.Output | Address where the output file is stored. For more information, see Submitting Multi-File Zipping Job. | Container | Yes |
Operation.UserData | The user information passed through, which is printable ASCII codes of up to 1,024 in length. | String | No |
QueueId | ID of the queue where the job is in | String | Yes |
CallBackFormat | Job callback format, which can be JSON or XML (default). It takes priority over that of the queue. | String | No |
CallBackType | Job callback type, which can be Url (default) or TDMQ . It takes priority over that of the queue. | String | No |
CallBack | Job callback address. It takes higher priority over that of the queue. | String | No |
CallBackMqConfig | TDMQ configuration for job callback as described in Structure, which is required if CallBackType is TDMQ . | Container | No |
type FileProcessJobResult struct {JobsDetail FileProcessJobResult}type FileProcessJobResult struct {Code stringMessage stringJobId stringTag stringState stringCreationTime stringStartTime stringEndTime stringQueueId stringInput *FileProcessInputOperation *FileProcessJobOperation}
Parameter | Description | Type |
JobsDetail | Job details | Container |
Code | Error code, which will be returned only if State is Failed . | String |
Message | Error message, which will be returned only if State is Failed . | String |
JobId | Job ID | String |
Tag | Job tag: FileCompress | String |
State | Job status. Valid values: Submitted , Running , Success , Failed , Pause , Cancel . | String |
CreationTime | Job creation time | String |
StartTime | Job start time | String |
EndTime | Job end time | String |
QueueId | ID of the queue which the job is in | String |
Input | Path of the input file for this job. For more information, see FileProcessJobOptions.Input . | Container |
Operation | Operation rule. For more information, see FileProcessJobOptions.Operation . | Container |
func (s *CIService) DescribeFileProcessJob(ctx context.Context, jobid string) (*FileProcessJobResult, *Response, error)
jobid := "<jobid>"res, _, err := c.CI.DescribeFileProcessJob(context.Background(), jobid)
Parameter | Description | Type | Required |
jobid | File processing job ID | String | Yes |
type FileProcessJobResult struct {JobsDetail *FileProcessJobsDetail}
Parameter | Description | Type |
JobsDetail | Job details, which is the same as Response.JobsDetail in the CreateFileProcessJob API. | Container |
Was this page helpful?