func (s *CIService) CreateFileProcessJob(ctx context.Context, opt *FileProcessJobOptions) (*FileProcessJobResult, *Response, error)
createJobOpt := &cos.FileProcessJobOptions{Tag: "FileUncompress",Input: &cos.FileProcessInput{Object: "294028.zip",},Operation: &cos.FileProcessJobOperation{FileUncompressConfig: &cos.FileUncompressConfig{Prefix: "uncomp",PrefixReplaced: "1",},Output: &cos.FileProcessOutput{Region: "ap-beijing",Bucket: "test-1250000000",}},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}
参数名称 | 描述 | 类型 | 是否必选 |
Tag | 创建任务的 Tag,目前仅支持:FileUncompress | String | 是 |
Input | Container | 是 | |
Operation | 操作规则 | Container | 是 |
Operation.FileUncompressConfig | Container | 是 | |
Operation.FileUncompressResult | Container | 否 | |
Operation.Output | Container | 是 | |
Operation.UserData | 透传用户信息, 可打印的 ASCII 码, 长度不超过1024 | String | 否 |
QueueId | 任务所在的队列 ID | String | 是 |
CallBackFormat | 任务回调格式,JSON 或 XML,默认 XML,优先级高于队列的回调格式。 | String | 否 |
CallBackType | 任务回调类型,Url 或 TDMQ,默认 Url,优先级高于队列的回调类型。 | String | 否 |
CallBack | 任务回调的地址,优先级高于队列的回调地址。 | String | 否 |
CallBackMqConfig | Container | 否 |
type FileProcessJobResult struct {JobsDetail FileProcessJobResult}type FileProcessJobResult struct {Code stringMessage stringJobId stringTag stringState stringCreationTime stringStartTime stringEndTime stringQueueId stringInput *FileProcessInputOperation *FileProcessJobOperation}
参数名称 | 描述 | 类型 |
JobsDetail | 任务的详细信息 | Container |
Code | 错误码,只有 State 为 Failed 时有意义 | String |
Message | 错误描述,只有 State 为 Failed 时有意义 | String |
JobId | 新创建任务的 ID | String |
Tag | 新创建任务的 Tag:FileUncompress | String |
State | 任务的状态,为 Submitted、Running、Success、Failed、Pause、Cancel 其中一个 | String |
CreationTime | 任务的创建时间 | String |
StartTime | 任务的开始时间 | String |
EndTime | 任务的结束时间 | String |
QueueId | 任务所属的队列 ID | String |
Input | 该任务的输入文件路径,详情请参见 FileProcessJobOptions.Input | Container |
Operation | 该任务的规则,详情请参见 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)
参数名称 | 描述 | 类型 | 是否必选 |
jobid | 文件处理任务 ID | String | 是 |
type FileProcessJobResult struct {JobsDetail *FileProcessJobsDetail}
参数名称 | 描述 | 类型 |
JobsDetail | 任务的详细信息, 同 CreateFileProcessJob 接口的 Response.JobsDetail 节点 | Container |
本页内容是否解决了您的问题?