详情页标题前

腾讯云对象存储批量任务接口

详情页1

简介

文档提供关于批量任务接口的 API 概览以及 SDK 示例代码。说明:阅读本文档前请先打开 示例代码

触发任务(工作流)

接口文档及示例函数名

API 文档 示例函数名
触发任务(工作流) CreateInventoryTriggerJob

示例代码

func CreateInventoryTriggerJob() {    u, _ := url.Parse("https://test-123456789.cos.ap-chongqing.myqcloud.com")    cu, _ := url.Parse("https://test-123456789.ci.ap-chongqing.myqcloud.com")    b := &cos.BaseURL{BucketURL: u, CIURL: cu}    c := cos.NewClient(b, &http.Client{        Transport: &cos.AuthorizationTransport{            SecretID:  os.Getenv("COS_SECRETID"),            SecretKey: os.Getenv("COS_SECRETKEY"),            Transport: &debug.DebugRequestTransport{                RequestHeader: true,                RequestBody:    true,                ResponseHeader: true,                ResponseBody:   true,            },        },    })    rand.Seed(time.Now().UnixNano())    opt := &cos.CreateInventoryTriggerJobOptions{        Name: "trigger-" + strconv.Itoa(rand.Intn(100)),        Input: &cos.InventoryTriggerJobInput{            Manifest: "https://test-123456789.cos.ap-chongqing.myqcloud.com/cos_bucket_inventory/123456789/test/menu_instant_20220506171340/20220506/manifest.json",        },        Operation: &cos.InventoryTriggerJobOperation{            WorkflowIds: "web6ac56c1ef54dbfa44d7f4103203be9",            TimeInterval: cos.InventoryTriggerJobOperationTimeInterval{                Start: "2002-02-16T10:45:12+0800",                End:   "2022-05-16T10:45:12+0800",            },        },    }    DescribeInventoryTriggerJobRes, _, err := c.CI.CreateInventoryTriggerJob(context.Background(), opt)    log_status(err)    fmt.Printf("%+v\n", DescribeInventoryTriggerJobRes)}

触发任务(独立节点)

接口文档及示例函数名

API 文档 示例函数名
触发任务(独立节点) CreateInventoryTriggerJobByParam

示例代码

func CreateInventoryTriggerJobByParam() {    u, _ := url.Parse("https://test-123456789.cos.ap-chongqing.myqcloud.com")    cu, _ := url.Parse("https://test-123456789.ci.ap-chongqing.myqcloud.com")    b := &cos.BaseURL{BucketURL: u, CIURL: cu}    c := cos.NewClient(b, &http.Client{        Transport: &cos.AuthorizationTransport{            SecretID:  os.Getenv("COS_SECRETID"),            SecretKey: os.Getenv("COS_SECRETKEY"),            Transport: &debug.DebugRequestTransport{                RequestHeader: true,                RequestBody:    true,                ResponseHeader: true,                ResponseBody:   true,            },        },    })    rand.Seed(time.Now().UnixNano())    opt := &cos.CreateInventoryTriggerJobOptions{        Name: "trigger-" + strconv.Itoa(rand.Intn(100)),        Input: &cos.InventoryTriggerJobInput{            Prefix: "input/",        },        Type: "Job",        Operation: &cos.InventoryTriggerJobOperation{            TimeInterval: cos.InventoryTriggerJobOperationTimeInterval{                Start: "2002-02-16T10:45:12+0800",                End:   "2023-05-16T10:45:12+0800",            },            Tag: "Transcode",            JobParam: &cos.InventoryTriggerJobOperationJobParam{                TemplateId: "t00daf332ba39049f8bfb899c1ed0134b0",            },            JobLevel: 1,            UserData: "This is my CreateInventoryTriggerJob",            Output: &cos.JobOutput{                Region: "ap-chongqing",                Bucket: "test-123456789",                Object: "output/${InputName}_${InventoryTriggerJobId}.${ext}",            },        },    }    DescribeInventoryTriggerJobRes, _, err := c.CI.CreateInventoryTriggerJob(context.Background(), opt)    log_status(err)    fmt.Printf("%+v\n", DescribeInventoryTriggerJobRes)}

取消任务

接口文档及示例函数名

API 文档 示例函数名
取消任务 CancelInventoryTriggerJobs

示例代码

func CancelInventoryTriggerJobs() {    u, _ := url.Parse("https://test-123456789.cos.ap-chongqing.myqcloud.com")    cu, _ := url.Parse("https://test-123456789.ci.ap-chongqing.myqcloud.com")    b := &cos.BaseURL{BucketURL: u, CIURL: cu}    c := cos.NewClient(b, &http.Client{        Transport: &cos.AuthorizationTransport{            SecretID:  os.Getenv("COS_SECRETID"),            SecretKey: os.Getenv("COS_SECRETKEY"),            Transport: &debug.DebugRequestTransport{                RequestHeader: true,                RequestBody:    true,                ResponseHeader: true,                ResponseBody:   true,            },        },    })    jobId := "b56a3bbc0cd3011ecb09a52540038936c"    _, err := c.CI.CancelInventoryTriggerJob(context.Background(), jobId)    log_status(err)}

查询任务

接口文档及示例函数名

API 文档 示例函数名
查询任务 DescribeInventoryTriggerJob

示例代码

func DescribeInventoryTriggerJob() {    u, _ := url.Parse("https://test-123456789.cos.ap-chongqing.myqcloud.com")    cu, _ := url.Parse("https://test-123456789.ci.ap-chongqing.myqcloud.com")    b := &cos.BaseURL{BucketURL: u, CIURL: cu}    c := cos.NewClient(b, &http.Client{        Transport: &cos.AuthorizationTransport{            SecretID:  os.Getenv("COS_SECRETID"),            SecretKey: os.Getenv("COS_SECRETKEY"),            Transport: &debug.DebugRequestTransport{                RequestHeader: true,                RequestBody:    true,                ResponseHeader: true,                ResponseBody:   true,            },        },    })    jobId := "babc6cfc8cd2111ecb09a52540038936c"    DescribeWorkflowRes, _, err := c.CI.DescribeInventoryTriggerJob(context.Background(), jobId)    log_status(err)    fmt.Printf("%+v\n", DescribeWorkflowRes)}

批量拉取任务

接口文档及示例函数名

API 文档 示例函数名
批量拉取任务 DescribeInventoryTriggerJobs

示例代码

func DescribeInventoryTriggerJobs() {    u, _ := url.Parse("https://test-123456789.cos.ap-chongqing.myqcloud.com")    cu, _ := url.Parse("https://test-123456789.ci.ap-chongqing.myqcloud.com")    b := &cos.BaseURL{BucketURL: u, CIURL: cu}    c := cos.NewClient(b, &http.Client{        Transport: &cos.AuthorizationTransport{            SecretID:  os.Getenv("COS_SECRETID"),            SecretKey: os.Getenv("COS_SECRETKEY"),            Transport: &debug.DebugRequestTransport{                RequestHeader: true,                RequestBody:    true,                ResponseHeader: true,                ResponseBody:   true,            },        },    })    opt := &cos.DescribeInventoryTriggerJobsOptions{        States: "All",    }    DescribeWorkflowRes, _, err := c.CI.DescribeInventoryTriggerJobs(context.Background(), opt)    log_status(err)    fmt.Printf("%+v\n", DescribeWorkflowRes)}



对象存储官网1折活动,限时活动,即将结束,速速收藏
同尘科技腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠

转转请注明出处:https://www.yunxiaoer.com/145640.html

(0)
上一篇 2023年12月9日
下一篇 2023年12月9日
详情页2

相关推荐

  • 腾讯云对象存储判断对象是否存在

    简介 本文档提供快捷查询存储桶中某个对象是否存在的示例代码。示例代码实际调用了 COS API HeadObject,是该接口的简化版。HeadObject 除了检查对象是否存在,主要功能为返回对象元数据。包含了 HeadObject 完整功能的 SDK 接口,可参见 查询对象元数据。 查询对象元数据 功能说明 检查存储桶中是否存在某个对象。 方法原型 pu…

    腾讯云 2023年12月9日
  • 腾讯云对象存储更新模板

    功能描述 更新图片处理模板。 授权说明 授权策略中 action 设置为 ci:UpdateMediaTemplate 。查看所有 action。 服务开通 使用该功能需提前开通数据万象,并绑定存储桶。详情请参见 绑定存储桶。 使用限制 使用该接口时,请先确认相关限制条件。详情请参见 使用限制。 请求 请求示例 PUT /template/<Temp…

    腾讯云 2023年12月9日
  • DMS数仓开发调度任务的问题。当前在重跑补数据?-云小二-阿里云

    DMS数仓开发调度任务的问题。当前在重跑补数据?是否可以设置自动重跑。有的时候莫名其妙原因失败,再跑一次就好了,他能设置失败了自动重跑1次么。这个任务大概跑3分钟,但是红框这几个跑了2小时。看了下时间都是在等待,他在等待啥,我这个阶段数据库上没什么任务啊

    2023年12月27日
  • 腾讯云对象存储下载对象

    简介 本文档提供关于对象的下载操作相关的 API 概览以及 SDK 示例代码。简单操作 API 操作名 操作描述 GET Object 下载对象 下载一个对象至本地 高级接口(推荐) 下载对象(断点续传) 功能说明 分块下载接口根据用户对象的长度,自动使用 Range 下载数据,实现并发下载,分块大小默认1048576(1MB),可通过 part_size …

    腾讯云 2023年12月9日
  • 信息流广告,信息流部分建议宽度830px,只针对默认列表样式,顺序随机
  • 腾讯云对象存储图片二维码生成

    简介 本文档提供关于图片二维码生成的相关 API 概览以及 SDK 示例代码。 API 操作描述 图片二维码生成 数据万象二维码生成功能可根据用户指定的文本信息(URL 或文本),生成对应的二维码或条形码。 SDK API 参考 SDK 所有接口的具体参数与方法说明,请参考 SDK API。 图片二维码生成 功能说明 数据万象二维码生成功能可根据用户指定…

    腾讯云 2023年12月9日

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信
本站为广大会员提供阿里云、腾讯云、华为云、百度云等一线大厂的购买,续费优惠,保证底价,买贵退差。