PreviewEnvironment - 预览环境变更信息

预览环境变更信息

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
devs:PreviewEnvironmentget
*全部资源
*

请求语法

GET /2023-07-14/projects/{projectName}/environments/{name}/preview HTTP/1.1

请求参数

名称类型必填描述示例值
projectNamestring

项目名称

demo-project
namestring

环境名称

demo-env

返回参数

名称类型描述示例值
EnvironmentDeploymentSpec

预期环境部署配置

示例

正常返回示例

JSON格式

{
  "changes": {
    "services": {
      "test": "test",
      "test2": 1
    }
  },
  "baseline": {
    "services": {
      "key": {
        "config": {
          "props": {
            "test": "test",
            "test2": 1
          },
          "source": {
            "template": {
              "downloadUrl": "https://api.devsapp.cn/v3/packages/start-modelscope-v3/zipball/0.1.6",
              "name": "start-springboot-cap"
            },
            "repository": {
              "repositoryName": "my-repository",
              "codeVersion": {
                "branch": "main",
                "commitID": "12721ec262d03a93809ba2bbc717963cb298ceca"
              },
              "filter": {
                "branch": {
                  "name": "master"
                }
              }
            },
            "oss": {
              "bucket": "demo-bucket",
              "object": "demo-object"
            }
          },
          "build": {
            "default": {
              "cache": {
                "driver": "",
                "paths": [
                  "~/.npm"
                ],
                "keyPath": {
                  "3C75C832-0EAD-40D6-8FA1-2BA9171C926B": "~/.npm",
                  "D256BB7A-1886-4A19-A75B-A1FDC23D5A00": "~/.cache"
                }
              },
              "languages": [
                "Python3.9"
              ],
              "rootPath": "./src",
              "steps": [
                {
                  "run": "npm build"
                }
              ]
            }
          },
          "variables": {
            "key": {
              "value": "object_value",
              "sensitive": false,
              "encrypted": false
            }
          },
          "initialize": {
            "steps": [
              {
                "run": "npm build"
              }
            ]
          },
          "type": "Function",
          "finalize": {
            "steps": [
              {
                "run": "echo 'deleted'"
              }
            ]
          },
          "token": "9D72DE01-C732-49C0-8E85-FFD9D695436B",
          "component": "fc3@1.0.0",
          "artifact": {
            "name": "my-artifact",
            "checksum": "CRC-64 code"
          }
        },
        "variables": {
          "key": {
            "value": "object_value",
            "sensitive": false,
            "encrypted": false
          }
        },
        "outputs": {
          "key": ""
        },
        "latestDeployment": {
          "name": "",
          "startTime": "",
          "finishedTime": "",
          "phase": "Running"
        },
        "status": "RUNNING",
        "message": "OK"
      }
    }
  },
  "target": {
    "services": {
      "key": {
        "props": {
          "test": "test",
          "test2": 1
        },
        "source": {
          "template": {
            "downloadUrl": "https://api.devsapp.cn/v3/packages/start-modelscope-v3/zipball/0.1.6",
            "name": "start-springboot-cap"
          },
          "repository": {
            "repositoryName": "my-repository",
            "codeVersion": {
              "branch": "main",
              "commitID": "12721ec262d03a93809ba2bbc717963cb298ceca"
            },
            "filter": {
              "branch": {
                "name": "master"
              }
            }
          },
          "oss": {
            "bucket": "demo-bucket",
            "object": "demo-object"
          }
        },
        "build": {
          "default": {
            "cache": {
              "driver": "",
              "paths": [
                "~/.npm"
              ],
              "keyPath": {
                "3C75C832-0EAD-40D6-8FA1-2BA9171C926B": "~/.npm",
                "D256BB7A-1886-4A19-A75B-A1FDC23D5A00": "~/.cache"
              }
            },
            "languages": [
              "Python3.9"
            ],
            "rootPath": "./src",
            "steps": [
              {
                "run": "npm build"
              }
            ]
          }
        },
        "variables": {
          "key": {
            "value": "object_value",
            "sensitive": false,
            "encrypted": false
          }
        },
        "initialize": {
          "steps": [
            {
              "run": "npm build"
            }
          ]
        },
        "type": "Function",
        "finalize": {
          "steps": [
            {
              "run": "echo 'deleted'"
            }
          ]
        },
        "token": "9D72DE01-C732-49C0-8E85-FFD9D695436B",
        "component": "fc3@1.0.0",
        "artifact": {
          "name": "my-artifact",
          "checksum": "CRC-64 code"
        }
      }
    },
    "variables": {}
  },
  "skipRemoveResources": false,
  "webhookCodeContext": {
    "description": "my PR decscription",
    "message": "commit message",
    "eventType": "PUSH",
    "commitID": "b1dd9ba168dfef1cb3a1dd608b6054c771a93959",
    "branch": "master",
    "sourceBranch": "master",
    "title": "# FIX",
    "tag": "release-0.0.1",
    "prType": "merged",
    "targetBranch": "master",
    "repoUrl": "https://codeup.aliyun.com/my-namespace/my-repo.git"
  }
}

错误码

访问错误中心查看更多错误码。