You need to enable JavaScript to run this app.
导航
ListPipelines
最近更新时间:2024.07.02 21:03:13首次发布时间:2024.07.02 21:03:13

查询流水线列表。

请求说明

请求方式:POST
请求地址:https://open.volcengineapi.com/?Action=ListPipelines&Version=2023-05-01

请求参数

参数类型是否必选示例值描述
ActionStringListPipelines公共参数,本接口值:ListPipelines。
VersionString2023-05-01公共参数,本接口值:2023-05-01。
WorkspaceIdString3f5f09a059124d6898a8543e678f****工作区 ID。
FilterObject PipelineFilter待查询流水线的过滤条件。

PageSize

Integer

10

分页查询时每页显示的记录数,取值:

  • 最小值:1
  • 最大值:100
  • 默认值:10

PageNumber

Integer

1

分页查询时的起始页码,从 1 开始,默认为 1。

PipelineFIlter

参数类型是否必选示例值描述
NameStringfoo按流水线名称过滤,模糊查询。
IdsArray of String["9d3f01e4f7ee4293a7cfc0c2d4d6****"]按流水线 ID 过滤,精确查询。

请求示例

POST /?Action=ListPipelines&Version=2023-05-01 HTTP/1.1
Content-Type:application/json
{
  "WorkspaceId": "3f5f09a059124d6898a8543e678f****",
  "PageNumber": 1,
  "PageSize": 10,
  "Filter": {
      "Name": "test",
      "Ids": [
          "9d3f01e4f7ee4293a7cfc0c2d4d6****"
      ]
  }
}

返回参数

参数类型示例值描述
TotalCountInteger10流水线总数。
ItemsArray of Pipeline流水线列表。
PageSizeInteger10分页大小。
PagetNumberInteger1当前页码。

Pipeline

参数类型示例值描述
IdString67d0485e1efb44128f0d990cdad6****流水线 ID。
NameStringpipelineName流水线名称。
WorkspaceIdString9d3f01e4f7ee4293a7cfc0c2d4d6****流水线所属工作区 ID。
DescriptionString这是一段描述流水线描述信息。
SpecString流水线编排 YAML 描述信息。
ResourcesArray of PipelineResource流水线资源相关配置,目前指代码源。
ParametersArray of PipelineParameter流水线变量配置。
CachesArray of PipelineCache流水线缓存配置。
NotificationObject PipelineNotification流水线消息通知配置。
CreatorObject IAMUser流水线创建人。
CreateTimeString2023-05-10T21:33:20Z流水线创建时间。
UpdateTimeString2023-05-10T21:33:20Z流水线更新时间。

PipelineResource

参数类型示例值描述
IdString669631b1495540a49915ede9893d****代码源 ID。
ConfigurationObject PipelineResourceConfiguration代码源配置。

PipelineResourceConfiguration

参数类型示例值描述
GitObject GitResourceConfigurationGit 代码源配置。

GitResourceConfiguration

参数类型示例值描述
DefaultBranchStringmaster默认分支。

PipelineCache

参数类型示例值描述
KeyStringm2缓存目录名称。
PathString$(CP_WORKSPACE)/.m2缓存路径。
DescriptionStringthis is a param description缓存目录备注。

PipelineNotification

参数类型示例值描述

Events

Array of String

["EventPipelineStarted"]

触发消息通知的事件列表。

  • EventPipelineStarted:开始运行
  • EventPipelineSucceeded:运行成功
  • EventPipelineFailed:运行失败
  • EventPipelineCanceled:运行取消

EnableSiteLetter

Boolean

true/false

是否开启站内信通知。

  • true:开启站内信通知
  • false:不开启站内信通知
SmsObject NotificationTarget短信消息通知配置。
EmailObject NotificationTarget邮件消息通知配置。
WebhookObject WebhookNotificationWebhook 消息通知配置。
CustomContentString自定义消息自定义的消息通知内容。

NotificationTarget

参数类型示例值描述

Enable

String

true/false

是否开启通知。

  • true:开启通知
  • false:不开启通知

Tragets

Array of String

["Triggerer", "Creator"]

通知目标。

  • Triggerer:流水线运行人
  • Creator:流水线创建人

WebhookNotification

参数类型示例值描述

Enable

String

true/false

是否开启通知。

  • true:开启通知
  • false:不开启通知

Type

String

Lark

Webhook 类型。

  • Lark:飞书 Webhook
  • Common:通用 Webhook
UrlStringhttps://open.feishu.cn/open-apis/bot/v2/hook/2e5c3202-aa81-4b14-****WebhookURL。
TokenString4W0TEVvODT8hK4e****调用 Token。

返回示例

HTTP/1.1 200 OK
Content-Type:application/json
{
    "ResponseMetadata": {
        "RequestId": "202404031138595E5D8BD124299EB9****",
        "Action": "ListPipelines",
        "Version": "2023-05-01",
        "Service": "cp",
        "Region": "cn-beijing",
    },
    "Result": {
        "Items": [
            {
                "Id": "67d0485e1efb44128f0d990cdad6****",
                "Name": "test-v2-pipeline_1683717039073",
                "WorkspaceId": "9d3f01e4f7ee4293a7cfc0c2d4d6****",
                "Description": "",
                "Spec": "version: 1.0.0\nstages:\n  - stage: stage-1\n    displayName: 阶段-1\n    tasks:\n      - dependsOn: []\n        task: task1\n        displayName: 任务-1\n        steps:\n          - step: exec-cmd\n            displayName: 命令执行\n            inputs:\n              shell: BASH\n              cmd: |-\n                sleep 200\n\n                echo 'aa'\n            component: execCmd@1.0.0/shell\n        plugins: []\n        outputs: []\n        timeout:\n          time: '2'\n          unit: h\n        workspace:\n          resources:\n            - ref: test111\n              directory: $(CP_WORKSPACE)\n          caches:\n            - cacheKey: m2\n              directory: $(CP_WORKSPACE)/m2\n              cachePolicy: pull-push\n            - cacheKey: gradle\n              directory: $(CP_WORKSPACE)/gradle\n              cachePolicy: pull-push\n            - cacheKey: npm\n              directory: $(CP_WORKSPACE)/npm\n              cachePolicy: pull-push\nagentPool: public/sit-v2-public\n",
                "Resources": [
                    {
                        "Id": "669631b1495540a49915ede9893d****",
                        "Configuration": {
                            "Git": {
                                "DefaultBranch": "demo"
                            }
                        }
                    }
                ],
                "CreateTime": "2023-05-10T19:10:39Z",
                "UpdateTime": "2023-05-10T21:33:20Z",
                "Creator": {
                    "AccountId": 140000****,
                    "UserId": 0
                },
                "Draft": false
            }
        ],
        "PageSize": 10,
        "PageNumber": 1,
        "TotalCount": 1
    }
}

错误码

当前接口暂无独立错误码,若接口调用返回异常,可参考 公共错误码 进行故障排查。