Updated on 2025-07-10 GMT+08:00

Parsing a Release Task Template Package

Function

This API is used to parse a release task template package.

URI

GET /v3/{project_id}/pipeline/pipelines/parse-template-package

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID. See Obtaining a Project ID.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Default value: application/json;charset=utf8.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see Authentication.

Table 3 Request body parameter

Parameter

Mandatory

Type

Description

sources

Yes

Array of objects

Source of the component template package. See Table 4.

Table 4 sources

Parameter

Mandatory

Type

Description

input_values

No

Map<String, String>

Template package input information.

template_source

Yes

Object

Source of the component template package. See Table 5.

Table 5 template_source

Parameter

Mandatory

Type

Description

storage

Yes

String

Storage mode of the component template package.

  • devcloud: CodeArts release repository
  • obs
  • http: custom file address

url

Yes

String

Address of the component template package.

This parameter is valid only when the component template package storage mode is http.

http_username

No

String

Username.

This parameter is valid only when the component template package storage mode is http and the security authentication mode is username and password authentication.

http_password

No

String

Password.

This parameter is valid only when the component template package storage mode is http and the security authentication mode is username and password authentication.

http_headers

No

Array of objects

Request header. See Table 6.

This parameter is valid only when the component template package storage mode is http and the security authentication mode is custom header authentication.

Table 6 http_headers

Parameter

Mandatory

Type

Description

key

Yes

String

Request key.

value

Yes

String

Request value.

Response

Table 7 Response parameter

Parameter

Type

Description

template_contents

Array of objects

Template package parsing content.

Table 8 template_contents

Parameter

Type

Description

template

Map<String, String>

Template package file information.

variables

Map<String, Object>

Template package variable declaration information.

input_values

Map<String, String>

Template package input information.

package_name

String

Package name.

Table 9 variables

Parameter

Type

Description

type

String

Variable type.

default

String

Default variable value.

description

String

Variable description.

Example Request

Parse the demo-app-package.zip release task template package stored in the obs://apitest/ directory of the OBS bucket.

{
    "sources": [
        {
            "template_source": {
                "storage": "obs",
                "url": "obs://apitest/demo-app-package.zip",
                "http_username": "",
                "http_password": "",
                "http_headers": []
            },
            "input_values": {}
        }
    ],
    "pipeline_id": null
}

Example Response

{
    "template_contents": [
        {
            "template": {
                "comp1/spec.yaml": "model_version: v1.0.0\n\ncomponent:\n  component_dir: comp_demo/\n\nk8s_resources:\n  order_type: CUSTOM\n  custom_orders:\n    - ServiceAccount\n    - Role\n    - RoleBinding\n    - ConfigMap\n    - Secret\n    - Deployment\n    - HorizontalPodAutoscaler\n    - Service\n    - Ingress",
                "comp2/variables.yaml": "variable:\n  namespace:\n    type: string\n    default: demo\n    description: namespace\n  dep_name:\n    type: string\n    default: demo-dep\n    description: workload name\n  svc_port:\n    type: integer\n    default: 8080\n    description: service port number\n  value:\n    type: string\n    default: World\n    description: Hello interface response data\n  cce_resource:\n    type: cce\n    description: CCE resource\n  image:\n    type: string\n    description: workload image",
                "values.yaml": "namespace: demo\ndep_name: demo-dep\nsvc_port: 8080\nvalue: World\nimage: swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "comp3/comp_demo/ss-component.yaml": "kind: ServiceStageComponent\nspec:\n  name: zyh-component-3\n  environment_name: default/env-ayl\n  refer_resources:\n    - type: cce\n      id: c90a1197-c26c-11ef-8078-0255ac10009a",
                "comp2/comp_demo/deployment.yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: zyh-test-dep-2\n  namespace: default\nspec:\n  selector:\n    matchLabels: {}\n  template:\n    metadata:\n      labels: {}\n    spec:\n      containers:\n        - name: container-1\n          image: swr.ap-southeast-1.myhuaweicloud.com/ss/test3:v1\n          imagePullPolicy: IfNotPresent\n          resources:\n            requests:\n              cpu: 100m\n              memory: 256Mi\n            limits:\n              cpu: 100m\n              memory: 256Mi\n      imagePullSecrets:\n        - name: default-secret\n      terminationGracePeriodSeconds: 30\n      dnsPolicy: ClusterFirst\n  replicas: 2\n  revisionHistoryLimit: 10\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxUnavailable: 25%\n      maxSurge: 25%\n  progressDeadlineSeconds: 600\n",
                "comp1/comp_demo/ss-component.yaml": "kind: ServiceStageComponent\nspec:\n  name: zyh-component-1\n  environment_name: default/env-ayl\n  refer_resources:\n    - type: cce\n      id: c90a1197-c26c-11ef-8078-0255ac10009a",
                "comp1/variables.yaml": "variable:\n  namespace:\n    type: string\n    default: demo\n    description: namespace\n  dep_name:\n    type: string\n    default: demo-dep\n    description: workload name\n  svc_port:\n    type: integer\n    default: 8080\n    description: service port number\n  value:\n    type: string\n    default: World\n    description: Hello interface response data\n  cce_resource:\n    type: cce\n    description: CCE resource\n  image:\n    type: string\n    description: workload image",
                "comp1/comp_demo/deployment.yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: zyh-test-dep-1\n  namespace: default\nspec:\n  selector:\n    matchLabels: {}\n  template:\n    metadata:\n      labels: {}\n    spec:\n      containers:\n        - name: container-1\n          image: swr.ap-southeast-1.myhuaweicloud.com/ss/test3:v1\n          imagePullPolicy: IfNotPresent\n          resources:\n            requests:\n              cpu: 100m\n              memory: 256Mi\n            limits:\n              cpu: 100m\n              memory: 256Mi\n      imagePullSecrets:\n        - name: default-secret\n      terminationGracePeriodSeconds: 30\n      dnsPolicy: ClusterFirst\n  replicas: 2\n  revisionHistoryLimit: 10\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxUnavailable: 25%\n      maxSurge: 25%\n  progressDeadlineSeconds: 600\n",
                "comp2/values.yaml": "namespace: demo\ndep_name: demo-dep\nsvc_port: 8080\nvalue: World\nimage: swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "comp3/spec.yaml": "model_version: v1.0.0\n\ndependency:\n  - component_name: zyh-component-2\n    application_name: default/test-application-zyh\n  - component_name: zyh-component-1\n    application_name: default/test-application-zyh\n\ncomponent:\n  component_dir: comp_demo/\n\nk8s_resources:\n  order_type: CUSTOM\n  custom_orders:\n    - ServiceAccount\n    - Role\n    - RoleBinding\n    - ConfigMap\n    - Secret\n    - Deployment\n    - HorizontalPodAutoscaler\n    - Service\n    - Ingress",
                "comp1/values.yaml": "namespace: demo\ndep_name: demo-dep\nsvc_port: 8080\nvalue: World\nimage: swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "comp3/variables.yaml": "variable:\n  namespace:\n    type: string\n    default: demo\n    description: namespace\n  dep_name:\n    type: string\n    default: demo-dep\n    description: workload name\n  svc_port:\n    type: integer\n    default: 8080\n    description: service port number\n  value:\n    type: string\n    default: World\n    description: Hello interface response data\n  cce_resource:\n    type: cce\n    description: CCE resource\n  image:\n    type: string\n    description: workload image",
                "comp2/spec.yaml": "model_version: v1.0.0\n\ncomponent:\n  component_dir: comp_demo/\n\nk8s_resources:\n  order_type: CUSTOM\n  custom_orders:\n    - ServiceAccount\n    - Role\n    - RoleBinding\n    - ConfigMap\n    - Secret\n    - Deployment\n    - HorizontalPodAutoscaler\n    - Service\n    - Ingress",
                "/variables.yaml": "variable:\n  namespace:\n    type: string\n    default: demo\n    description: namespace\n  dep_name:\n    type: string\n    default: demo-dep\n    description: workload name\n  svc_port:\n    type: integer\n    default: 8080\n    description: service port number\n  value:\n    type: string\n    default: World\n    description: Hello interface response data\n  cce_resource:\n    type: cce\n    description: CCE resource\n  image:\n    type: string\n    description: workload image",
                "spec.yaml": "model_version: v1.0.0\n\nmodel_type: Application",
                "comp3/comp_demo/deployment.yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: zyh-test-dep-3\n  namespace: default\nspec:\n  selector:\n    matchLabels: {}\n  template:\n    metadata:\n      labels: {}\n    spec:\n      containers:\n        - name: container-1\n          image: swr.ap-southeast-1.myhuaweicloud.com/ss/test3:v1\n          imagePullPolicy: IfNotPresent\n          resources:\n            requests:\n              cpu: 100m\n              memory: 256Mi\n            limits:\n              cpu: 100m\n              memory: 256Mi\n      imagePullSecrets:\n        - name: default-secret\n      terminationGracePeriodSeconds: 30\n      dnsPolicy: ClusterFirst\n  replicas: 2\n  revisionHistoryLimit: 10\n  strategy:\n    type: RollingUpdate\n    rollingUpdate:\n      maxUnavailable: 25%\n      maxSurge: 25%\n  progressDeadlineSeconds: 600\n",
                "comp3/values.yaml": "namespace: demo\ndep_name: demo-dep\nsvc_port: 8080\nvalue: World\nimage: swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "application.yaml": "kind: ServiceStageApplication\nspec:\n    name: test-application-zyh\n    enterprise_project_id: 0",
                "comp2/comp_demo/ss-component.yaml": "kind: ServiceStageComponent\nspec:\n  name: zyh-component-2\n  environment_name: default/env-ayl\n  refer_resources:\n    - type: cce\n      id: c90a1197-c26c-11ef-8078-0255ac10009a"
            },
            "variable": {
                "comp2/dep_name": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo-dep",
                    "description": "workload name"
                },
                "comp1/image": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": null,
                    "description": "workload image"
                },
                "image": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": null,
                    "description": "workload image"
                },
                "comp2/value": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "World",
                    "description": "Hello interface response data"
                },
                "comp3/cce_resource": {
                    "parsed_type": {
                        "type": "cce",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "cce",
                    "sensitive": false,
                    "default": null,
                    "description": "CCE resource"
                },
                "comp1/namespace": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo",
                    "description": "namespace"
                },
                "comp1/value": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "World",
                    "description": "Hello interface response data"
                },
                "comp3/namespace": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo",
                    "description": "namespace"
                },
                "svc_port": {
                    "parsed_type": {
                        "type": "integer",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "integer",
                    "sensitive": false,
                    "default": 8080,
                    "description": "service port number"
                },
                "cce_resource": {
                    "parsed_type": {
                        "type": "cce",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "cce",
                    "sensitive": false,
                    "default": null,
                    "description": "CCE resource"
                },
                "comp1/svc_port": {
                    "parsed_type": {
                        "type": "integer",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "integer",
                    "sensitive": false,
                    "default": 8080,
                    "description": "service port number"
                },
                "comp3/value": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "World",
                    "description": "Hello interface response data"
                },
                "comp1/cce_resource": {
                    "parsed_type": {
                        "type": "cce",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "cce",
                    "sensitive": false,
                    "default": null,
                    "description": "CCE resource"
                },
                "comp3/image": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": null,
                    "description": "workload image"
                },
                "dep_name": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo-dep",
                    "description": "workload name"
                },
                "comp2/cce_resource": {
                    "parsed_type": {
                        "type": "cce",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "cce",
                    "sensitive": false,
                    "default": null,
                    "description": "CCE resource"
                },
                "comp1/dep_name": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo-dep",
                    "description": "workload name"
                },
                "comp3/dep_name": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo-dep",
                    "description": "workload name"
                },
                "comp3/svc_port": {
                    "parsed_type": {
                        "type": "integer",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "integer",
                    "sensitive": false,
                    "default": 8080,
                    "description": "service port number"
                },
                "comp2/svc_port": {
                    "parsed_type": {
                        "type": "integer",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "integer",
                    "sensitive": false,
                    "default": 8080,
                    "description": "service port number"
                },
                "namespace": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo",
                    "description": "namespace"
                },
                "comp2/image": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": null,
                    "description": "workload image"
                },
                "value": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "World",
                    "description": "Hello interface response data"
                },
                "comp2/namespace": {
                    "parsed_type": {
                        "type": "string",
                        "properties": null,
                        "item_type": null
                    },
                    "type": "string",
                    "sensitive": false,
                    "default": "demo",
                    "description": "namespace"
                }
            },
            "input_values": {
                "comp2/dep_name": "demo-dep",
                "comp1/image": "swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "image": "swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "comp2/value": "World",
                "comp3/cce_resource": null,
                "comp1/namespace": "demo",
                "comp1/value": "World",
                "comp3/namespace": "demo",
                "svc_port": 8080,
                "cce_resource": null,
                "comp1/svc_port": 8080,
                "comp3/value": "World",
                "comp1/cce_resource": null,
                "comp3/image": "swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "dep_name": "demo-dep",
                "comp2/cce_resource": null,
                "comp1/dep_name": "demo-dep",
                "comp3/dep_name": "demo-dep",
                "comp3/svc_port": 8080,
                "comp2/svc_port": 8080,
                "namespace": "demo",
                "comp2/image": "swr.ap-southeast-1.myhuaweicloud.com/ss/demo-app:latest",
                "value": "World",
                "comp2/namespace": "demo"
            },
            "package_name": "demo-app-package.zip"
        }
    ]
}

Status Code

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

See ServiceStage Error Codes.