日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

Webhooks

更新時(shí)間:

本文主要介紹 Webhooks 事件,允許開發(fā)人員通過訂閱應(yīng)用事件(新建應(yīng)用、環(huán)境部署完成、變更發(fā)布、研發(fā)流程運(yùn)行成功等)來對接三方平臺,如三方項(xiàng)目管理平臺、自有CMDB平臺、三方部署運(yùn)維平臺等。

1. Webhooks 配置

1.1 新建 Webhook

應(yīng)用交付AppStack提供了全局 Webhooks 和應(yīng)用內(nèi) Webhooks,全局 Webhooks 對企業(yè)下所有應(yīng)用生效,應(yīng)用內(nèi) Webhooks 僅對當(dāng)前應(yīng)用生效。

  • 操作入口:全局 Webhooks,進(jìn)入 AppStack 首頁 -> 全局設(shè)置 -> Webhooks,單擊新建Webhook;應(yīng)用內(nèi) Webhooks,進(jìn)入目標(biāo)應(yīng)用 -> 設(shè)置 -> Webhooks,點(diǎn)擊新建 Webhook 。

  • 填寫 Webhook 參數(shù):

    • URL:必填,Webhook觸發(fā)地址,以傳輸協(xié)議 http 或 https 開頭。

    • Secret Token:非必填,在請求的 X-AppStack-Token HTTP頭中發(fā)送,用于接收方驗(yàn)證請求合法性。

    • 描述:非必填,通常描述 Webhook 用途。

    • 觸發(fā)事件:單擊勾選需要訂閱的事件,詳見 Webhooks 事件列表。

image

1.2 測試 Webhook

配置 Webhook 后可對 Webhook 的可用性進(jìn)行驗(yàn)證,單擊 測試Webhook 將自動以新建應(yīng)用 Mock 示例進(jìn)行調(diào)用觸發(fā)目標(biāo)事件,以測試 URL 連通性。

image

image

1.3 觸發(fā)歷史

進(jìn)入 Webhooks 列表,支持查看 Webhook 觸發(fā)歷史,查看觸發(fā)時(shí)間耗時(shí)、以及觸發(fā)具體的 RequestResponse,用于觸發(fā)歷史追溯和問題排查。

image

2. Webhooks Headers 和 Body 說明

當(dāng)滿足觸發(fā)事件時(shí),云效應(yīng)用交付 AppStack 會發(fā)送一個(gè)帶數(shù)據(jù)的 POST 請求到 Webhook 指定的 URL。

  • 請求的 Headers 說明如下:

    • X-AppStack-Event:觸發(fā)請求的事件對象。

    • X-AppStack-Action:觸發(fā)請求的事件動作。

    • X-AppStack-Token:Secret Token,用于接收方驗(yàn)證請求合法性。

    • X-AppStack-App:觸發(fā)請求的事件歸屬應(yīng)用。

  • 請求的 Body 說明如下:

    • id:事件觸發(fā)記錄唯一 id。

    • user:事件操作觸發(fā)用戶信息。

    • orgId:事件觸發(fā)歸屬的企業(yè)ID。

    • time:事件觸發(fā)的時(shí)間,格式為毫秒級時(shí)間戳,如:1734233196163。

    • objectKind:事件觸發(fā)對象類型,包括 應(yīng)用App、環(huán)境Env、部署單ChangeOrder、應(yīng)用編排AppOrchestration、變量組VariableGroup、變更ChangeRequest、研發(fā)階段ReleaseStageExecution,詳見 3. Webhooks 事件列表。

    • objectAttributes:事件觸發(fā)對象屬性,詳見 3. Webhooks 事件列表。

3. Webhooks 事件列表

3.1 應(yīng)用

3.1.1 新建應(yīng)用

Headers

{
    "X-AppStack-Event": "App",
    "X-AppStack-Action": "Create",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetApplication API。

{
    "id": "07ebabc883e14ec78612656bbef61925",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": 1734232981572,
    "objectKind": "App",
    "objectAttributes": {
        "name": "myapp-demo",
        "description": "這是一個(gè)測試應(yīng)用",
        "type": "APP"
    }
}

3.1.2 刪除應(yīng)用

Headers

{
    "X-AppStack-Event": "App",
    "X-AppStack-Action": "Delete",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetApplication API。

{
    "id": "ecd0f8a7b6a6473bbbc3e5212ec33929",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T06:50:25.480+00:00",
    "objectKind": "App",
    "objectAttributes": {
        "name": "myapp-demo",
        "description": "這是一個(gè)測試應(yīng)用",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722235582000,
        "type": "APP"
    }
}

3.2 環(huán)境

3.2.1 新建環(huán)境

Headers

{
    "X-AppStack-Event": "Env",
    "X-AppStack-Action": "Create",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetEnvironment API。

{
    "id": "ecfc8a274ff3479e9bfa07e421a06b9c",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:06:04.104+00:00",
    "objectKind": "Env",
    "objectAttributes": {
        "name": "test-env",
        "displayName": "測試環(huán)境",
        "appName": "myapp-demo",
        "description": "這是測試環(huán)境,用于日常測試驗(yàn)證",
        "lockBy": null,
        "resourcePoolName": "default",
        "deployGroupName": "demo-k8s-cluster",
        "profiles": [
            {
                "name": "test-vars",
                "displayName": "測試環(huán)境變量組",
                "type": "APP"
            }
        ],
        "spec": {
            "rolloutStrategy": null,
            "replicasManagement": "SYSTEM"
        },
        "labelList": [
            {
                "namespace": "default",
                "name": "envType",
                "value": "test",
                "displayName": "環(huán)境級別",
                "displayValue": "測試環(huán)境"
            }
        ]
    }
}

3.2.2 環(huán)境設(shè)置

Headers

{
    "X-AppStack-Event": "Env",
    "X-AppStack-Action": "Update",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetEnvironment API。

{
    "id": "64f6e280c9814f668ca56f713b6af19d",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:07:42.536+00:00",
    "objectKind": "Env",
    "objectAttributes": {
        "name": "test-env",
        "displayName": "測試環(huán)境",
        "appName": "myapp-demo",
        "description": "這是測試環(huán)境,用于日常測試驗(yàn)證",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722236764000,
        "lockBy": "61c92a37ae805dbacc5b9f78",
        "resourcePoolName": "default",
        "deployGroupName": "demo-k8s-cluster",
        "profiles": [
            {
                "name": "test-vars",
                "displayName": "測試環(huán)境變量組",
                "type": "APP"
            }
        ],
        "spec": {
            "rolloutStrategy": [
                {
                    "locator": "*",
                    "batches": null,
                    "batchSteps": null,
                    "timeOutMS": 1200000,
                    "targetReplicas": null,
                    "batchMode": "ConfirmFirstBatch",
                    "deployType": "Rolling"
                }
            ],
            "replicasManagement": "USER"
        },
        "labelList": [
            {
                "namespace": "default",
                "name": "envType",
                "value": "test",
                "displayName": "環(huán)境級別",
                "displayValue": "測試環(huán)境"
            }
        ]
    }
}

3.2.3 刪除環(huán)境

Headers

{
    "X-AppStack-Event": "Env",
    "X-AppStack-Action": "Delete",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetEnvironment API。

{
    "id": "f189080c26b94cdcbf069debdfeeff97",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:09:04.612+00:00",
    "objectKind": "Env",
    "objectAttributes": {
        "name": "test-env",
        "displayName": "測試環(huán)境",
        "appName": "myapp-demo",
        "description": "這是測試環(huán)境,用于日常測試驗(yàn)證",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722236764000,
        "lockBy": null,
        "resourcePoolName": "default",
        "deployGroupName": "demo-k8s-cluster",
        "profiles": [
            {
                "name": "test-vars",
                "displayName": "測試環(huán)境變量組",
                "type": "APP"
            }
        ],
        "spec": {
            "rolloutStrategy": [
                {
                    "locator": "*",
                    "batches": null,
                    "batchSteps": null,
                    "timeOutMS": 1200000,
                    "targetReplicas": null,
                    "batchMode": "ConfirmFirstBatch",
                    "deployType": "Rolling"
                }
            ],
            "replicasManagement": "USER"
        },
        "labelList": [
            {
                "namespace": "default",
                "name": "envType",
                "value": "test",
                "displayName": "環(huán)境級別",
                "displayValue": "測試環(huán)境"
            }
        ]
    }
}

3.3 部署單

3.3.1 部署單狀態(tài)更新

Headers

{
    "X-AppStack-Event": "ChangeOrder",
    "X-AppStack-Action": "StatusUpdate",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetChangeOrder API。其中sourceType 有 3 種類型,每種類型含義及對應(yīng)的sourceSn 含義如下:

  • sourceType 為CUSTOMIZE:從AppStack環(huán)境頁面創(chuàng)建,對應(yīng)的 sourceSn 為觸發(fā)人云效用戶id;

  • sourceType 為FLOW:從流水線AppStack部署組件觸發(fā),對應(yīng)的 sourceSn 為流水線id;

  • sourceType 為OPEN_API:從AppStack OpenApi觸發(fā),無sourceSn。

{
    "id": "ca59d8f8f6224eb3b518af9c2145aca5",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "620321f073741507cb7d0cfd",
    "time": "2024-08-15T06:43:34.911+00:00",
    "objectKind": "ChangeOrder",
    "objectAttributes": {
        "name": "20240815144312-部署",
        "appName": "myapp-demo",
        "type": "Deploy",
        "startedAt": 1723704199000,
        "version": "20240815144312-310",
        "tag": "myapp-demo::20240815144315::626e429",
        "state": "FAILED",
        "overrideFinishState": null,
        "controlMode": "Auto",
        "description": null,
        "jobs": [
            {
                "sn": "1aa8d03f6b574681af203447812d1d61",
                "name": "20240815144312-部署",
                "envName": "test",
                "appName": "myapp-demo",
                "changeableEnvSn": "8480d937c656460fada9ca27f37f63a3",
                "resourceType": "KUBERNETES",
                "changeOrderSn": "32468993abb14653ae9d86cf5d1cac98",
                "nextSn": null,
                "priority": 0,
                "profiles": [
                    {
                        "name": "test",
                        "displayName": "測試環(huán)境變量組",
                        "type": "APP"
                    }
                ],
                "startedAt": 1723704199000,
                "endedAt": 1723704215000,
                "state": "FAILED",
                "overrideFinishState": null,
                "controlMode": "Auto",
                "stages": [
                    {
                        "sn": "9436683c270d447ab22045de5642b027",
                        "jobSn": "1aa8d03f6b574681af203447812d1d61",
                        "resourceType": "KUBERNETES",
                        "priority": 1,
                        "startedAt": 1723704199000,
                        "endedAt": 1723704206000,
                        "state": "SUCCESS",
                        "overrideFinishState": null,
                        "controlMode": "Auto",
                        "name": "順序1",
                        "tasks": [
                            {
                                "sn": "b8c82092f1a04d829154fde67bc4e0af",
                                "name": "myapp-demo-test",
                                "resourceType": "KUBERNETES",
                                "jobSn": "1aa8d03f6b574681af203447812d1d61",
                                "locator": "myapp-demo-test/default/core/v1/Service",
                                "stageSn": "9436683c270d447ab22045de5642b027",
                                "priority": 0,
                                "startedAt": 1723704199000,
                                "endedAt": 1723704202000,
                                "state": "SUCCESS",
                                "overrideFinishState": null,
                                "strategyContent": "{\"behavior\":\"Upsert\"}",
                                "contextContent": "{\"appName\":\"myapp-demo\",\"envName\":\"test\",\"name\":\"myapp-demo-test\",\"changeOrderVersion\":\"20240815144312-310\",\"artifacts\":{},\"version\":\"v1\",\"jobType\":\"Deploy\",\"group\":\"core\",\"namespace\":\"default\",\"deployGroupName\":\"c8c18031145b74e20811ae8bb59cea7fb\",\"planningStatus\":null,\"kind\":\"Service\",\"currentPassIndex\":null,\"extendParams\":{},\"initialRevisions\":null,\"locator\":\"myapp-demo-test/default/core/v1/Service\",\"apiVersion\":\"core/v1\"}",
                                "deliveries": "---\napiVersion: \"v1\"\nkind: \"Service\"\nmetadata:\n  name: \"myapp-demo-test\"\n  namespace: \"default\"\nspec:\n  selector:\n    run: \"myapp-demo-test\"\n  ports:\n  - protocol: \"TCP\"\n    port: 80\n    targetPort: 8080\n",
                                "spec": "---\napiVersion: \"v1\"\nkind: \"Service\"\nmetadata:\n  name: \"myapp-demo-test\"\n  namespace: \"default\"\n  labels:\n    devops.aliyun.com/app-name: \"myapp-demo\"\n    devops.aliyun.com/version: \"20240815144312-310\"\n    devops.aliyun.com/org-id: \"620321f073741507cb7d0cfd\"\n    devops.aliyun.com/env-name: \"test\"\nspec:\n  selector:\n    run: \"myapp-demo-test\"\n  ports:\n  - protocol: \"TCP\"\n    port: 80\n    targetPort: 8080\n",
                                "engineTaskKey": "77b1c704-70fd-445a-ae58-c2dc2bfc2147",
                                "engineTaskResultContent": "{\"typeKey\":\"Ade2@KUBERNETES\",\"deliverySn\":\"77b1c704-70fd-445a-ae58-c2dc2bfc2147\",\"state\":\"SUCCESSFUL\",\"userParam\":{\"X-Tenant-Id\":\"620321f073741507cb7d0cfd\",\"X-Operator-Id\":\"646dabc05ccc4ad1bc2a9e2f\",\"traceId\":\"1889cf906d064cb7861cefe989d5a5b5.794.17237041982184057\",\"typeKey\":\"Ade2@KUBERNETES\"},\"statistics\":null,\"podRevision\":null,\"serviceBrief\":{\"ports\":[\"TCP 80:8080\"],\"clusterIp\":\"172.16.192.188\"},\"purgeStatistics\":null,\"callbackParams\":{},\"taskErrorMessages\":{},\"snapshotType\":null,\"snapshotKey\":null,\"uid\":null,\"info\":null,\"resourceType\":\"KUBERNETES\",\"typeKey\":\"Ade2@KUBERNETES\",\"engineTaskKey\":\"77b1c704-70fd-445a-ae58-c2dc2bfc2147\"}",
                                "orgId": "620321f073741507cb7d0cfd"
                            }
                        ]
                    },
                    {
                        "sn": "d7cce8a19c3f4343b9a56102e970063a",
                        "jobSn": "1aa8d03f6b574681af203447812d1d61",
                        "resourceType": "KUBERNETES",
                        "priority": 2,
                        "startedAt": 1723704206000,
                        "endedAt": 1723704215000,
                        "state": "FAILED",
                        "overrideFinishState": null,
                        "controlMode": "Auto",
                        "name": "順序2",
                        "tasks": [
                            {
                                "sn": "c86e2410edae4b948e1f11b683954810",
                                "name": "myapp-demo-test",
                                "resourceType": "KUBERNETES",
                                "jobSn": "1aa8d03f6b574681af203447812d1d61",
                                "locator": "myapp-demo-test/default/apps/v1/Deployment",
                                "stageSn": "d7cce8a19c3f4343b9a56102e970063a",
                                "priority": 0,
                                "startedAt": 1723704206000,
                                "endedAt": 1723704208000,
                                "state": "FAILED",
                                "overrideFinishState": null,
                                "strategyContent": "{\"version\":\"v2\",\"behavior\":\"Upsert\",\"batches\":2,\"batchSteps\":[{\"type\":\"WEIGHT\",\"value\":\"20\"},{\"type\":\"WEIGHT\",\"value\":\"80\"}],\"quickRollback\":null,\"targetReplicas\":null,\"fromReplicas\":null,\"timeOutMS\":600000,\"batchMode\":\"Manual\",\"deployType\":\"Batch\",\"deleteDeployGroup\":false,\"restraint\":null,\"totalReplicas\":null}",
                                "contextContent": "{\"appName\":\"myapp-demo\",\"envName\":\"test\",\"name\":\"myapp-demo-test\",\"changeOrderVersion\":\"20240815144312-310\",\"artifacts\":{\"image.backend\":\"yunxiao-registry.cn-beijing.cr.aliyuncs.com/test/demo1:emoji-2024-06-18-15-22-45\"},\"version\":\"v1\",\"jobType\":\"Deploy\",\"group\":\"apps\",\"namespace\":\"default\",\"deployGroupName\":\"c8c18031145b74e20811ae8bb59cea7fb\",\"planningStatus\":null,\"kind\":\"Deployment\",\"currentPassIndex\":0,\"extendParams\":{},\"initialRevisions\":[\"20240815144312-310\",\"20240702150459-614\"],\"locator\":\"myapp-demo-test/default/apps/v1/Deployment\",\"apiVersion\":\"apps/v1\"}",
                                "deliveries": "---\napiVersion: \"apps/v1\"\nkind: \"Deployment\"\nmetadata:\n  name: \"myapp-demo-test\"\n  namespace: \"default\"\n  labels:\n    run: \"myapp-demo-test\"\nspec:\n  replicas: \"l\"\n  selector:\n    matchLabels:\n      run: \"myapp-demo-test\"\n  template:\n    metadata:\n      labels:\n        run: \"myapp-demo-test\"\n    spec:\n      containers:\n      - name: \"main\"\n        image: \"yunxiao-registry.cn-beijing.cr.aliyuncs.com/test/demo1:emoji-2024-06-18-15-22-45\"\n        ports:\n        - containerPort: 8080\n        resources:\n          limits:\n            cpu: 1\n            memory: \"1024Mi\"\n          requests:\n            cpu: 0.01\n            memory: \"32Mi\"\n",
                                "spec": "---\napiVersion: \"apps/v1\"\nkind: \"Deployment\"\nmetadata:\n  name: \"myapp-demo-test\"\n  namespace: \"default\"\n  labels:\n    run: \"myapp-demo-test\"\n    devops.aliyun.com/app-name: \"myapp-demo\"\n    devops.aliyun.com/env-name: \"test\"\n    devops.aliyun.com/version: \"20240815144312-310\"\n    devops.aliyun.com/org-id: \"620321f073741507cb7d0cfd\"\nspec:\n  replicas: \"l\"\n  selector:\n    matchLabels:\n      run: \"myapp-demo-test\"\n  template:\n    metadata:\n      labels:\n        run: \"myapp-demo-test\"\n        devops.aliyun.com/app-name: \"myapp-demo\"\n        devops.aliyun.com/env-name: \"test\"\n        devops.aliyun.com/version: \"20240815144312-310\"\n        devops.aliyun.com/org-id: \"620321f073741507cb7d0cfd\"\n    spec:\n      containers:\n      - name: \"main\"\n        image: \"yunxiao-registry.cn-beijing.cr.aliyuncs.com/test/demo1:emoji-2024-06-18-15-22-45\"\n        ports:\n        - containerPort: 8080\n        resources:\n          limits:\n            cpu: 1\n            memory: \"1024Mi\"\n          requests:\n            cpu: 0.01\n            memory: \"32Mi\"\n",
                                "engineTaskKey": "59bb15fb-3454-4d0b-8a15-41e943786ed7",
                                "engineTaskResultContent": "{\"typeKey\":\"Ade2@KUBERNETES\",\"deliverySn\":\"59bb15fb-3454-4d0b-8a15-41e943786ed7\",\"state\":\"FAILED\",\"userParam\":{\"X-Tenant-Id\":\"620321f073741507cb7d0cfd\",\"X-Operator-Id\":\"646dabc05ccc4ad1bc2a9e2f\",\"traceId\":\"1889cf906d064cb7861cefe989d5a5b5.794.17237041982184057\",\"typeKey\":\"Ade2@KUBERNETES\"},\"statistics\":{\"externalOrderId\":null,\"rolloutId\":null,\"strategy\":\"Batch\",\"currentPassIndex\":0,\"totalPasses\":2,\"passStatus\":\"FAILED\",\"overallStatus\":\"FAILED\",\"passStatistics\":null,\"overallStatistics\":null,\"batchStatisticList\":[{\"updatedReplicas\":20,\"desiredReplicas\":20},{\"updatedReplicas\":0,\"desiredReplicas\":100}],\"purgeStatistics\":null,\"lastPass\":false},\"podRevision\":{\"newRevisions\":[{\"name\":\"notExists-0\",\"status\":\"NotExists\",\"age\":\"2024-08-15T06:43:27Z\",\"deployGroupName\":null,\"namespace\":null,\"refWorkload\":null,\"revision\":\"20240815144312-310\"}],\"oldRevisions\":[{\"name\":\"myapp-demo-test-6655b7f48d-pmwbs\",\"status\":\"Running\",\"age\":\"2024-07-02T07:05:27Z\",\"deployGroupName\":null,\"namespace\":\"default\",\"refWorkload\":null,\"revision\":\"20240702150459-614\"},{\"name\":\"myapp-demo-test-6655b7f48d-hqqqc\",\"status\":\"Running\",\"age\":\"2024-07-02T07:05:59Z\",\"deployGroupName\":null,\"namespace\":\"default\",\"refWorkload\":null,\"revision\":\"20240702150459-614\"},{\"name\":\"myapp-demo-test-6655b7f48d-zhbj9\",\"status\":\"Running\",\"age\":\"2024-07-02T07:06:00Z\",\"deployGroupName\":null,\"namespace\":\"default\",\"refWorkload\":null,\"revision\":\"20240702150459-614\"}]},\"serviceBrief\":null,\"purgeStatistics\":null,\"callbackParams\":{},\"taskErrorMessages\":{\"Delivery[59bb15fb-3454-4d0b-8a15-41e943786ed7]\":\"Error occurs when preparing delivery[59bb15fb-3454-4d0b-8a15-41e943786ed7]: Cannot deserialize value of type `int` from String \\\"l\\\": not a valid `int` value\\n at [Source: (StringReader); line: 16, column: 13] (through reference chain: io.fabric8.kubernetes.api.model.apps.Deployment[\\\"spec\\\"]->io.fabric8.kubernetes.api.model.apps.DeploymentSpec[\\\"replicas\\\"])\"},\"snapshotType\":\"OSS\",\"snapshotKey\":\"620321f073741507cb7d0cfdc86e2410edae4b948e1f11b683954810\",\"uid\":null,\"info\":null,\"resourceType\":\"KUBERNETES\",\"typeKey\":\"Ade2@KUBERNETES\",\"engineTaskKey\":\"59bb15fb-3454-4d0b-8a15-41e943786ed7\"}",
                                "orgId": "620321f073741507cb7d0cfd"
                            }
                        ]
                    }
                ],
                "type": "Deploy",
                "snapshot": {
                    "deployGroup": {
                        "name": "c8c18031145b74e20811ae8bb59cea7fb",
                        "displayName": "devops-pre-autotest-002",
                        "description": "",
                        "poolName": "default",
                        "appSelector": null,
                        "claimList": [
                            {
                                "sn": "1b516ad73f7947339d56d33656a6b95c",
                                "type": "ACK",
                                "instanceName": "c8c18031145b74e20811ae8bb59cea7fb",
                                "specMap": {},
                                "itemSnList": [],
                                "refType": null,
                                "refId": null
                            }
                        ],
                        "creator": "646dabc05ccc4ad1bc2a9e2f"
                    }
                }
            }
        ],
        "sn": "32468993abb14653ae9d86cf5d1cac98",
        "creator": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1723704199000,
        "sourceType": "CUSTOMIZE",
        "sourceSn": "646dabc05ccc4ad1bc2a9e2f"
    }
}

3.4 應(yīng)用編排

3.4.1 新建編排

Headers

{
    "X-AppStack-Event": "AppOrchestration",
    "X-AppStack-Action": "Create",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetAppOrchestration API。

{
    "id": "c534abbceaad422fbb56ed7c53298675",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:10:27.934+00:00",
    "objectKind": "AppOrchestration",
    "objectAttributes": {
        "storageType": "BUILTIN",
        "app": {
            "name": "myapp-demo",
            "description": "這是一個(gè)測試應(yīng)用",
            "creatorId": "646dabc05ccc4ad1bc2a9e2f",
            "gmtCreate": 1722236335000,
            "type": "APP"
        },
        "format": "MANIFEST",
        "suitableResourceTypes": [
            "KUBERNETES"
        ],
        "sn": "myapp-demo@KUBERNETES",
        "revision": {
            "sha": "73f3aa0a977946dbc79f948ba0933b1ab3962b2f",
            "message": "Initialize choreography",
            "author": "646dabc05ccc4ad1bc2a9e2f",
            "commitTime": 1722237027908
        },
        "name": "myapp-demo",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722237027894,
        "modifierId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtModified": 1722237027894,
        "type": "AppBuiltInOrchestration",
        "labelPolicy": "NONE",
        "labelList": [],
        "syncSourceTemplate": null,
        "placeholderList": [
            {
                "name": "image.backend",
                "description": "后端服務(wù)鏡像",
                "type": "string",
                "value": "NULL",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": true,
                "rsType": "KUBERNETES"
            },
            {
                "name": "envName",
                "description": "環(huán)境名",
                "type": "string",
                "value": "APPSTACK_ENV_NAME",
                "overridable": false,
                "rule": null,
                "valueSource": "VARIABLE",
                "predefined": true,
                "rsType": "KUBERNETES"
            },
            {
                "name": "namespace",
                "description": "命名空間",
                "type": "string",
                "value": "default",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "cpuLimit",
                "description": "CPU限制",
                "type": "string",
                "value": "1",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "memoryLimit",
                "description": "內(nèi)存限制",
                "type": "string",
                "value": "1024Mi",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "cpuRequest",
                "description": "CPU請求",
                "type": "string",
                "value": "0.01",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "memoryRequest",
                "description": "內(nèi)存請求",
                "type": "string",
                "value": "32Mi",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            }
        ],
        "componentList": [
            {
                "name": "demo-service",
                "kind": "Service",
                "description": "服務(wù)訪問策略",
                "content": "---\napiVersion: v1\nkind: Service\nmetadata:\n  name: myapp-demo-{{ .AppStack.envName }}\n  # 命名空間配置:\n  # 建議每個(gè)環(huán)境使用不同的Kubernetes集群命名空間,以便達(dá)到環(huán)境隔離效果\n  # 部署時(shí)云效會將占位符{{ .Values.namespace }}替換成右側(cè)設(shè)置的實(shí)際值\n  namespace: {{ .Values.namespace }}\nspec:\n  selector:\n    run: myapp-demo-{{ .AppStack.envName }}\n  ports:\n    - protocol: TCP\n      port: 80\n      targetPort: 8080",
                "priority": 1,
                "type": "KUBERNETES"
            },
            {
                "name": "demo-deployment",
                "kind": "Deployment",
                "description": "無狀態(tài)應(yīng)用",
                "content": "---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: myapp-demo-{{ .AppStack.envName }}\n  labels:\n    run: myapp-demo-{{ .AppStack.envName }}\n  # 命名空間配置:\n  # 建議每個(gè)環(huán)境使用不同的Kubernetes集群命名空間,以便達(dá)到環(huán)境隔離效果\n  # 部署時(shí)云效會將占位符{{ .Values.namespace }}替換成右側(cè)設(shè)置的實(shí)際值\n  namespace: {{ .Values.namespace }}\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      run: myapp-demo-{{ .AppStack.envName }}\n  template:\n    metadata:\n      labels:\n        run: myapp-demo-{{ .AppStack.envName }}\n    spec:\n      containers:\n        - name: main\n          # 鏡像配置:\n          # 部署時(shí)云效會將預(yù)置占位符{{ .AppStack.image.backend }}替換成實(shí)際部署時(shí)的鏡像\n          # 支持在新建部署單時(shí)手動輸入鏡像地址,也支持接收流水線的上游構(gòu)建產(chǎn)物\n          # 另外,在右側(cè)鏡像占位符處添加多個(gè)鏡像,可以支持SideCar或InitContainer等多容器場景\n          image: {{ .AppStack.image.backend }}\n          # 端口配置:\n          ports:\n            - containerPort: 8080\n          # 資源規(guī)格配置:\n          # 當(dāng)不同環(huán)境有不同的CPU或內(nèi)存資源規(guī)格要求時(shí),可以定義占位符搭配變量組使用\n          # 如,設(shè)置{{ .Values.cpuLimit }}占位符,部署時(shí)云效會將占位符{{ .Values.cpuLimit }}替換成右側(cè)設(shè)置的實(shí)際值\n          resources:\n            limits:\n              cpu: {{ .Values.cpuLimit }}\n              memory: {{ .Values.memoryLimit }}\n            requests:\n              cpu: {{ .Values.cpuRequest }}\n              memory: {{ .Values.memoryRequest }}\n          # 生命周期配置:\n          #lifecycle:\n          #  preStop:\n          #    exec:\n          #      command: [ \"/bin/bash\", \"-c\", \"sleep 10\" ]\n          # 探活配置:\n          #livenessProbe:\n          #  initialDelaySeconds: 10\n          #  failureThreshold: 3\n          #  periodSeconds: 5\n          #  successThreshold: 1\n          #  timeoutSeconds: 2\n          #  httpGet:\n          #    scheme: HTTP\n          #    path: /health\n          #    port: 7002\n          # 就緒探測配置:\n          #readinessProbe:\n          #  initialDelaySeconds: 60\n          #  failureThreshold: 4\n          #  periodSeconds: 10\n          #  successThreshold: 1\n          #  timeoutSeconds: 3\n          #  httpGet:\n          #    scheme: HTTP\n          #    port: 7002\n          #    path: /health",
                "priority": 2,
                "type": "KUBERNETES"
            }
        ]
    }
}

3.4.2 編排更新

Headers

{
    "X-AppStack-Event": "AppOrchestration",
    "X-AppStack-Action": "Update",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetAppOrchestration API。

{
    "id": "4bcd40b2c1044260b2bd946b2195981d",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:14:47.991+00:00",
    "objectKind": "AppOrchestration",
    "objectAttributes": {
        "storageType": "BUILTIN",
        "app": {
            "name": "myapp-demo",
            "description": "這是一個(gè)測試應(yīng)用",
            "creatorId": "646dabc05ccc4ad1bc2a9e2f",
            "gmtCreate": 1722236335000,
            "type": "APP"
        },
        "format": "MANIFEST",
        "suitableResourceTypes": [
            "KUBERNETES"
        ],
        "sn": "myapp-demo@KUBERNETES",
        "revision": {
            "sha": "7277190c92046cb56d4ba5941cbce4b78c11337c",
            "message": "修改端口號為8081",
            "author": "646dabc05ccc4ad1bc2a9e2f",
            "commitTime": 1722237287949
        },
        "name": "myapp-demo",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722237028000,
        "modifierId": "61c92a37ae805dbacc5b9f78",
        "gmtModified": 1734234554000,
        "type": "AppBuiltInOrchestration",
        "labelPolicy": "FROM_LABEL_BINDING",
        "labelList": [
            {
                "namespace": "default",
                "name": "envType",
                "value": "dev",
                "displayName": "環(huán)境級別",
                "displayValue": "開發(fā)環(huán)境"
            },
            {
                "namespace": "default",
                "name": "envType",
                "value": "test",
                "displayName": "環(huán)境級別",
                "displayValue": "測試環(huán)境"
            },
            {
                "namespace": "default",
                "name": "envType",
                "value": "prepub",
                "displayName": "環(huán)境級別",
                "displayValue": "預(yù)發(fā)環(huán)境"
            },
            {
                "namespace": "default",
                "name": "envType",
                "value": "production",
                "displayName": "環(huán)境級別",
                "displayValue": "生產(chǎn)環(huán)境"
            }
        ],
        "syncSourceTemplate": null,
        "placeholderList": [
            {
                "name": "image.backend",
                "description": "后端服務(wù)鏡像",
                "type": "string",
                "value": "NULL",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": true,
                "rsType": "KUBERNETES"
            },
            {
                "name": "envName",
                "description": "環(huán)境名",
                "type": "string",
                "value": "APPSTACK_ENV_NAME",
                "overridable": false,
                "rule": null,
                "valueSource": "VARIABLE",
                "predefined": true,
                "rsType": "KUBERNETES"
            },
            {
                "name": "namespace",
                "description": "命名空間",
                "type": "string",
                "value": "default",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "cpuLimit",
                "description": "CPU限制",
                "type": "string",
                "value": "1",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "memoryLimit",
                "description": "內(nèi)存限制",
                "type": "string",
                "value": "1024Mi",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "cpuRequest",
                "description": "CPU請求",
                "type": "string",
                "value": "0.01",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "memoryRequest",
                "description": "內(nèi)存請求",
                "type": "string",
                "value": "32Mi",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            }
        ],
        "componentList": [
            {
                "name": "demo-service",
                "kind": "Service",
                "description": "服務(wù)訪問策略",
                "content": "---\napiVersion: v1\nkind: Service\nmetadata:\n  name: myapp-demo-{{ .AppStack.envName }}\n  # 命名空間配置:\n  # 建議每個(gè)環(huán)境使用不同的Kubernetes集群命名空間,以便達(dá)到環(huán)境隔離效果\n  # 部署時(shí)云效會將占位符{{ .Values.namespace }}替換成右側(cè)設(shè)置的實(shí)際值\n  namespace: {{ .Values.namespace }}\nspec:\n  selector:\n    run: myapp-demo-{{ .AppStack.envName }}\n  ports:\n    - protocol: TCP\n      port: 80\n      targetPort: 8081",
                "priority": 1,
                "type": "KUBERNETES"
            },
            {
                "name": "demo-deployment",
                "kind": "Deployment",
                "description": "無狀態(tài)應(yīng)用",
                "content": "---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: myapp-demo-{{ .AppStack.envName }}\n  labels:\n    run: myapp-demo-{{ .AppStack.envName }}\n  # 命名空間配置:\n  # 建議每個(gè)環(huán)境使用不同的Kubernetes集群命名空間,以便達(dá)到環(huán)境隔離效果\n  # 部署時(shí)云效會將占位符{{ .Values.namespace }}替換成右側(cè)設(shè)置的實(shí)際值\n  namespace: {{ .Values.namespace }}\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      run: myapp-demo-{{ .AppStack.envName }}\n  template:\n    metadata:\n      labels:\n        run: myapp-demo-{{ .AppStack.envName }}\n    spec:\n      containers:\n        - name: main\n          # 鏡像配置:\n          # 部署時(shí)云效會將預(yù)置占位符{{ .AppStack.image.backend }}替換成實(shí)際部署時(shí)的鏡像\n          # 支持在新建部署單時(shí)手動輸入鏡像地址,也支持接收流水線的上游構(gòu)建產(chǎn)物\n          # 另外,在右側(cè)鏡像占位符處添加多個(gè)鏡像,可以支持SideCar或InitContainer等多容器場景\n          image: {{ .AppStack.image.backend }}\n          # 端口配置:\n          ports:\n            - containerPort: 8080\n          # 資源規(guī)格配置:\n          # 當(dāng)不同環(huán)境有不同的CPU或內(nèi)存資源規(guī)格要求時(shí),可以定義占位符搭配變量組使用\n          # 如,設(shè)置{{ .Values.cpuLimit }}占位符,部署時(shí)云效會將占位符{{ .Values.cpuLimit }}替換成右側(cè)設(shè)置的實(shí)際值\n          resources:\n            limits:\n              cpu: {{ .Values.cpuLimit }}\n              memory: {{ .Values.memoryLimit }}\n            requests:\n              cpu: {{ .Values.cpuRequest }}\n              memory: {{ .Values.memoryRequest }}\n          # 生命周期配置:\n          #lifecycle:\n          #  preStop:\n          #    exec:\n          #      command: [ \"/bin/bash\", \"-c\", \"sleep 10\" ]\n          # 探活配置:\n          #livenessProbe:\n          #  initialDelaySeconds: 10\n          #  failureThreshold: 3\n          #  periodSeconds: 5\n          #  successThreshold: 1\n          #  timeoutSeconds: 2\n          #  httpGet:\n          #    scheme: HTTP\n          #    path: /health\n          #    port: 7002\n          # 就緒探測配置:\n          #readinessProbe:\n          #  initialDelaySeconds: 60\n          #  failureThreshold: 4\n          #  periodSeconds: 10\n          #  successThreshold: 1\n          #  timeoutSeconds: 3\n          #  httpGet:\n          #    scheme: HTTP\n          #    port: 7002\n          #    path: /health",
                "priority": 2,
                "type": "KUBERNETES"
            }
        ]
    }
}

3.4.3 刪除編排

Headers

{
    "X-AppStack-Event": "AppOrchestration",
    "X-AppStack-Action": "Delete",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetAppOrchestration API

{
    "id": "0001408e7e4743748a891beb6d3d87ae",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:17:31.418+00:00",
    "objectKind": "AppOrchestration",
    "objectAttributes": {
        "storageType": "BUILTIN",
        "app": {
            "name": "myapp-demo",
            "description": "這是建立于2024年07月29日的應(yīng)用",
            "creatorId": "646dabc05ccc4ad1bc2a9e2f",
            "gmtCreate": 1722236335000,
            "type": "APP"
        },
        "format": "MANIFEST",
        "suitableResourceTypes": [
            "KUBERNETES"
        ],
        "sn": "myapp-demo@KUBERNETES",
        "revision": {
            "sha": "7277190c92046cb56d4ba5941cbce4b78c11337c",
            "message": "修改端口號為8081",
            "author": "646dabc05ccc4ad1bc2a9e2f",
            "commitTime": 1722237287949
        },
        "name": "myapp-demo",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722237288000,
        "modifierId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtModified": 1722237288000,
        "type": "AppBuiltInOrchestration",
        "labelPolicy": "FROM_LABEL_BINDING",
        "labelList": [
            {
                "namespace": "default",
                "name": "envType",
                "value": "dev",
                "displayName": "環(huán)境級別",
                "displayValue": "開發(fā)環(huán)境"
            },
            {
                "namespace": "default",
                "name": "envType",
                "value": "test",
                "displayName": "環(huán)境級別",
                "displayValue": "測試環(huán)境"
            },
            {
                "namespace": "default",
                "name": "envType",
                "value": "production",
                "displayName": "環(huán)境級別",
                "displayValue": "生產(chǎn)環(huán)境"
            },
            {
                "namespace": "default",
                "name": "envType",
                "value": "prepub",
                "displayName": "環(huán)境級別",
                "displayValue": "預(yù)發(fā)環(huán)境"
            }
        ],
        "syncSourceTemplate": null,
        "placeholderList": [
            {
                "name": "image.backend",
                "description": "后端服務(wù)鏡像",
                "type": "string",
                "value": "NULL",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": true,
                "rsType": "KUBERNETES"
            },
            {
                "name": "envName",
                "description": "環(huán)境名",
                "type": "string",
                "value": "APPSTACK_ENV_NAME",
                "overridable": false,
                "rule": null,
                "valueSource": "VARIABLE",
                "predefined": true,
                "rsType": "KUBERNETES"
            },
            {
                "name": "namespace",
                "description": "命名空間",
                "type": "string",
                "value": "default",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "cpuLimit",
                "description": "CPU限制",
                "type": "string",
                "value": "1",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "memoryLimit",
                "description": "內(nèi)存限制",
                "type": "string",
                "value": "1024Mi",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "cpuRequest",
                "description": "CPU請求",
                "type": "string",
                "value": "0.01",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            },
            {
                "name": "memoryRequest",
                "description": "內(nèi)存請求",
                "type": "string",
                "value": "32Mi",
                "overridable": true,
                "rule": null,
                "valueSource": "CONSTANT",
                "predefined": false,
                "rsType": "KUBERNETES"
            }
        ],
        "componentList": [
            {
                "name": "demo-service",
                "kind": "Service",
                "description": "服務(wù)訪問策略",
                "content": "---\napiVersion: v1\nkind: Service\nmetadata:\n  name: myapp-demo-{{ .AppStack.envName }}\n  # 命名空間配置:\n  # 建議每個(gè)環(huán)境使用不同的Kubernetes集群命名空間,以便達(dá)到環(huán)境隔離效果\n  # 部署時(shí)云效會將占位符{{ .Values.namespace }}替換成右側(cè)設(shè)置的實(shí)際值\n  namespace: {{ .Values.namespace }}\nspec:\n  selector:\n    run: myapp-demo-{{ .AppStack.envName }}\n  ports:\n    - protocol: TCP\n      port: 80\n      targetPort: 8081",
                "priority": 1,
                "type": "KUBERNETES"
            },
            {
                "name": "demo-deployment",
                "kind": "Deployment",
                "description": "無狀態(tài)應(yīng)用",
                "content": "---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: myapp-demo-{{ .AppStack.envName }}\n  labels:\n    run: myapp-demo-{{ .AppStack.envName }}\n  # 命名空間配置:\n  # 建議每個(gè)環(huán)境使用不同的Kubernetes集群命名空間,以便達(dá)到環(huán)境隔離效果\n  # 部署時(shí)云效會將占位符{{ .Values.namespace }}替換成右側(cè)設(shè)置的實(shí)際值\n  namespace: {{ .Values.namespace }}\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      run: myapp-demo-{{ .AppStack.envName }}\n  template:\n    metadata:\n      labels:\n        run: myapp-demo-{{ .AppStack.envName }}\n    spec:\n      containers:\n        - name: main\n          # 鏡像配置:\n          # 部署時(shí)云效會將預(yù)置占位符{{ .AppStack.image.backend }}替換成實(shí)際部署時(shí)的鏡像\n          # 支持在新建部署單時(shí)手動輸入鏡像地址,也支持接收流水線的上游構(gòu)建產(chǎn)物\n          # 另外,在右側(cè)鏡像占位符處添加多個(gè)鏡像,可以支持SideCar或InitContainer等多容器場景\n          image: {{ .AppStack.image.backend }}\n          # 端口配置:\n          ports:\n            - containerPort: 8080\n          # 資源規(guī)格配置:\n          # 當(dāng)不同環(huán)境有不同的CPU或內(nèi)存資源規(guī)格要求時(shí),可以定義占位符搭配變量組使用\n          # 如,設(shè)置{{ .Values.cpuLimit }}占位符,部署時(shí)云效會將占位符{{ .Values.cpuLimit }}替換成右側(cè)設(shè)置的實(shí)際值\n          resources:\n            limits:\n              cpu: {{ .Values.cpuLimit }}\n              memory: {{ .Values.memoryLimit }}\n            requests:\n              cpu: {{ .Values.cpuRequest }}\n              memory: {{ .Values.memoryRequest }}\n          # 生命周期配置:\n          #lifecycle:\n          #  preStop:\n          #    exec:\n          #      command: [ \"/bin/bash\", \"-c\", \"sleep 10\" ]\n          # 探活配置:\n          #livenessProbe:\n          #  initialDelaySeconds: 10\n          #  failureThreshold: 3\n          #  periodSeconds: 5\n          #  successThreshold: 1\n          #  timeoutSeconds: 2\n          #  httpGet:\n          #    scheme: HTTP\n          #    path: /health\n          #    port: 7002\n          # 就緒探測配置:\n          #readinessProbe:\n          #  initialDelaySeconds: 60\n          #  failureThreshold: 4\n          #  periodSeconds: 10\n          #  successThreshold: 1\n          #  timeoutSeconds: 3\n          #  httpGet:\n          #    scheme: HTTP\n          #    port: 7002\n          #    path: /health",
                "priority": 2,
                "type": "KUBERNETES"
            }
        ]
    }
}

3.5 變量組

3.5.1 新建變量組

Headers

{
    "X-AppStack-Event": "VariableGroup",
    "X-AppStack-Action": "Create",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetVariableGroup API。

{
    "id": "2704eec852c6496293fbbd57a3756769",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:00:28.327+00:00",
    "objectKind": "VariableGroup",
    "objectAttributes": {
        "name": "test-vars",
        "displayName": "測試環(huán)境變量組",
        "vars": []
    }
}

3.5.2 變量組更新

Headers

{
    "X-AppStack-Event": "VariableGroup",
    "X-AppStack-Action": "Update",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetVariableGroup API。

{
    "id": "a8488254b29d4b8e97c2f8b45b84f14b",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:02:23.656+00:00",
    "objectKind": "VariableGroup",
    "objectAttributes": {
        "name": "test-vars",
        "displayName": "測試環(huán)境變量組",
        "vars": [
            {
                "key": "key1",
                "value": "value1",
                "description": "這是變量1"
            },
            {
                "key": "key2",
                "value": "value2",
                "description": "這是變量2"
            }
        ]
    }
}

3.5.3 刪除變量組

Headers

{
    "X-AppStack-Event": "VariableGroup",
    "X-AppStack-Action": "Delete",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 GetVariableGroup API。

{
    "id": "34483737e03746d6a0e60f5b767a9f24",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": "2024-07-29T07:03:40.665+00:00",
    "objectKind": "VariableGroup",
    "objectAttributes": {
        "name": "test-vars",
        "displayName": "測試環(huán)境變量組"
    }
}

3.6 變更

3.6.1 新建變更

Headers

{
    "X-AppStack-Event": "ChangeRequest",
    "X-AppStack-Action": "Create",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 CreateChangeRequest API

{
    "id": "8379c68b025c4dd0bf04dc8279bdad3e",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "630de053ca912501d6c92e10",
    "time": "2024-07-29T11:58:33.961+00:00",
    "objectKind": "ChangeRequest",
    "objectAttributes": {
        "sn": "c7ae55830f9043cd971f872282bdbc2e",
        "appName": "myapp-demo",
        "state": "DEVELOPING",
        "name": "日常變更001",
        "type": "APP",
        "appCodeRepoSn": "0f90e45370474414bd63bf2a9908042d",
        "appCodeRepo": {
            "sn": "0f90e45370474414bd63bf2a9908042d",
            "appName": "myapp-demo",
            "name": "myapp-demo",
            "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
            "identifier": "myapp_demo",
            "repoContext": {
                "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
                "projectId": "4536398",
                "defaultBranch": "master",
                "repoType": "CODEUP"
            },
            "connectionConfig": {
                "connectionId": "641004",
                "connectionType": "FLOW"
            }
        },
        "branch": "feature/20240729_001",
        "ownerId": "646dabc05ccc4ad1bc2a9e2f",
        "originBranch": "master",
        "originBranchRevision": "2d26ea0ada1317ce95ef0c5307c4bc234621e94e",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722254314000,
        "gmtModified": 1722254314000,
        "extInfo": {
            "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
            "repoType": "CODEUP",
            "appCodeRepo": {
                "sn": "0f90e45370474414bd63bf2a9908042d",
                "appName": "myapp-demo",
                "name": "myapp-demo",
                "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
                "identifier": "myapp_demo",
                "repoContext": {
                    "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
                    "projectId": "4536398",
                    "defaultBranch": "master",
                    "repoType": "CODEUP"
                },
                "connectionConfig": {
                    "connectionId": "641004",
                    "connectionType": "FLOW"
                }
            },
            "autoDeleteBranchWhenEnd": false
        }
    }
}

3.6.2 變更狀態(tài)更新

Headers

{
    "X-AppStack-Event": "ChangeRequest",
    "X-AppStack-Action": "StatusUpdate",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段說明參考 CreateChangeRequest API

{
    "id": "db926f9a92d64884b50401f7a19f8aa4",
    "user": {
        "id": "646dabc05ccc4ad1bc2a9e2f"
    },
    "orgId": "630de053ca912501d6c92e10",
    "time": "2024-07-29T12:00:53.660+00:00",
    "objectKind": "ChangeRequest",
    "objectAttributes": {
        "sn": "c7ae55830f9043cd971f872282bdbc2e",
        "appName": "myapp-demo",
        "state": "INTEGRATING",
        "name": "日常變更001",
        "type": "APP",
        "appCodeRepoSn": "0f90e45370474414bd63bf2a9908042d",
        "appCodeRepo": {
            "sn": "0f90e45370474414bd63bf2a9908042d",
            "appName": "myapp-demo",
            "name": "myapp-demo",
            "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
            "identifier": "myapp_demo",
            "repoContext": {
                "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
                "projectId": "4536398",
                "defaultBranch": "master",
                "repoType": "CODEUP"
            },
            "connectionConfig": {
                "connectionId": "641004",
                "connectionType": "FLOW"
            }
        },
        "branch": "feature/20240729_001",
        "ownerId": "646dabc05ccc4ad1bc2a9e2f",
        "originBranch": "master",
        "originBranchRevision": "2d26ea0ada1317ce95ef0c5307c4bc234621e94e",
        "creatorId": "646dabc05ccc4ad1bc2a9e2f",
        "gmtCreate": 1722254314000,
        "gmtModified": 1722254454000,
        "extInfo": {
            "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
            "repoType": "CODEUP",
            "appCodeRepo": {
                "sn": "0f90e45370474414bd63bf2a9908042d",
                "appName": "myapp-demo",
                "name": "myapp-demo",
                "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
                "identifier": "myapp_demo",
                "repoContext": {
                    "repoUrl": "https://codeup.aliyun.com/630de053ca912501d6c92e10/myapp-demo.git",
                    "projectId": "4536398",
                    "defaultBranch": "master",
                    "repoType": "CODEUP"
                },
                "connectionConfig": {
                    "connectionId": "641004",
                    "connectionType": "FLOW"
                }
            },
            "autoDeleteBranchWhenEnd": false
        }
    }
}

3.7 研發(fā)階段

3.7.1 研發(fā)流程階段運(yùn)行狀態(tài)更新

Headers

{
    "X-AppStack-Event": "ReleaseStageExecution",
    "X-AppStack-Action": "StatusUpdate",
    "X-AppStack-Token": "your-secret-token",
    "X-AppStack-App": "myapp-demo"
}

Body

請求 Body 詳細(xì)字段 objectAttributes 說明如下:

  • releaseWorkflowSn:研發(fā)流程sn

  • releaseStageSn:研發(fā)流程階段sn

  • engineInstanceId:格式為:流水線ID:運(yùn)行記錄編號

  • state:流水線運(yùn)行記錄狀態(tài)

  • context.triggerMode:流水線觸發(fā)方式

  • context.startTime:流水線運(yùn)行開始時(shí)間

  • context.endTime:流水線運(yùn)行結(jié)束時(shí)間

{
    "id": "0b3b23464e374d6985ea46a3d2d5d498",
    "user": {
        "id": "61c92a37ae805dbacc5b9f78"
    },
    "orgId": "60d54f3daccf2bbd6659f3ad",
    "time": 1734243628688,
    "objectKind": "ReleaseStageExecution",
    "objectAttributes": {
        "releaseStageSn": "80e65045dc794d3c921e81ec896b4693",
        "releaseWorkflowSn": "8abe97bf557b410f8ca389e564553af1",
        "engineInstanceId": "3786032:1",
        "state": "FAILED",
        "context": {
            "triggerMode": "MANUAL",
            "startTime": 1734243615000,
            "endTime": 1734243628295
        }
    }
}