REST API 指南
本节介绍 Spring Cloud Skipper REST API。
29. 概述
Spring Cloud Skipper 提供了一个 REST API,可让您访问服务器的各个方面。 Spring Cloud Skipper shell 是 API 的一流消费者。
29.1. HTTP 动词
Spring Cloud Skipper 在使用 HTTP 动词时试图尽可能严格地遵守标准 HTTP 和 REST 约定。 下表显示了每个动词以及 Skipper 如何使用它:
动词 | 用法 |
---|---|
|
用于检索资源。 |
|
用于创建新资源。 |
|
用于更新现有资源,包括部分更新。
也用于暗示 |
|
用于删除现有资源。 |
29.2. HTTP 状态代码
Skipper 在使用 HTTP 状态代码时尽可能严格遵守标准 HTTP 和 REST 约定。 下表显示了每个状态及其在 Skipper 中的含义:
状态代码 | 用法 |
---|---|
|
请求已成功完成。 |
|
已成功创建新资源。
资源的 URI 可从响应的 |
|
已成功应用对现有资源的更新。 |
|
该请求格式错误。响应正文包含提供更多信息的错误。 |
|
请求的资源不存在。 |
29.4. 错误
路径 | 类型 | 描述 |
---|---|---|
|
|
发生的 HTTP 错误(例如 |
|
|
错误原因的描述。 |
|
|
异常类。 |
|
|
发出请求的路径。 |
|
|
HTTP 状态代码(例如 |
|
|
发生错误的时间(以毫秒为单位)。 |
29.5. 超媒体
Spring Cloud Skipper 使用超媒体。
因此,资源在其响应中包含指向其他资源的链接。
更具体地说,响应采用超文本应用程序从资源到资源语言 (HAL) 格式。
链接可以在_links
钥匙。
API 的使用者不应自行创建 URI。
相反,他们应该使用资源中的链接进行导航。
30. 资源
30.1. 索引
索引提供了进入 Spring Cloud Skipper 的 REST API 的入口点。
30.1.1. 访问索引
您可以使用GET
请求访问索引。
示例响应
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 1366
{
"_links" : {
"repositories" : {
"href" : "http://localhost:7577/api/repositories{?page,size,sort}",
"templated" : true
},
"jpaRepositoryActions" : {
"href" : "http://localhost:7577/api/jpaRepositoryActions"
},
"jpaRepositoryGuards" : {
"href" : "http://localhost:7577/api/jpaRepositoryGuards"
},
"deployers" : {
"href" : "http://localhost:7577/api/deployers{?page,size,sort}",
"templated" : true
},
"jpaRepositoryStates" : {
"href" : "http://localhost:7577/api/jpaRepositoryStates"
},
"releases" : {
"href" : "http://localhost:7577/api/releases{?page,size,sort}",
"templated" : true
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata{?page,size,sort,projection}",
"templated" : true
},
"jpaRepositoryStateMachines" : {
"href" : "http://localhost:7577/api/jpaRepositoryStateMachines"
},
"jpaRepositoryTransitions" : {
"href" : "http://localhost:7577/api/jpaRepositoryTransitions"
},
"about" : {
"href" : "http://localhost:7577/api/about"
},
"release" : {
"href" : "http://localhost:7577/api/release"
},
"package" : {
"href" : "http://localhost:7577/api/package"
},
"profile" : {
"href" : "http://localhost:7577/api/profile"
}
}
}
30.2. 服务器
服务器资源公开服务器的生成和版本信息。
30.2.1. 服务器信息
一个GET
request 返回 Spring Cloud Skipper 的元信息,包括以下内容:
-
服务器名称 - 通常
spring-cloud-skipper-server
-
服务器版本 - 例如
2.11.5
30.3. 平台
Platforms(或Platform Deployer)资源是从Spring Data Repository导出的DeployerRepository
并由 Spring Data REST 公开。
30.3.1. 查找全部
一个GET
request 返回所有 Spring Cloud Skipper 平台部署程序的分页列表。
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 16050
{
"_embedded" : {
"deployers" : [ {
"name" : "default",
"type" : "local",
"description" : "ShutdownTimeout = [30], EnvVarsToInherit = [TMP,LANG,LANGUAGE,LC_.*,PATH,SPRING_APPLICATION_JSON], JavaCmd = [java], WorkingDirectoriesRoot = [/tmp], DeleteFilesOnExit = [true]",
"options" : [ {
"id" : "spring.cloud.deployer.local.docker.network",
"name" : "network",
"type" : "java.lang.String",
"description" : "Container network",
"shortDescription" : "Container network",
"defaultValue" : "bridge",
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.docker.volume-mounts",
"name" : "volume-mounts",
"type" : "java.lang.String",
"description" : "Set volume mappings",
"shortDescription" : "Set volume mappings",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.docker.port-mappings",
"name" : "port-mappings",
"type" : "java.lang.String",
"description" : "Set port mappings for container",
"shortDescription" : "Set port mappings for container",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.docker.additional-hosts",
"name" : "additional-hosts",
"type" : "java.lang.String",
"description" : "Set additional hosts",
"shortDescription" : "Set additional hosts",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.docker.delete-container-on-exit",
"name" : "delete-container-on-exit",
"type" : "java.lang.Boolean",
"description" : "Whether to delete the container on container exit.",
"shortDescription" : "Whether to delete the container on container exit.",
"defaultValue" : true,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.docker.port-range.low",
"name" : "low",
"type" : "java.lang.Integer",
"description" : "Lower bound for computing applications's random port.",
"shortDescription" : "Lower bound for computing applications's random port.",
"defaultValue" : 20000,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.docker.port-range.high",
"name" : "high",
"type" : "java.lang.Integer",
"description" : "Upper bound for computing applications's random port.",
"shortDescription" : "Upper bound for computing applications's random port.",
"defaultValue" : 61000,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.working-directories-root",
"name" : "working-directories-root",
"type" : "java.nio.file.Path",
"description" : "Directory in which all created processes will run and create log files.",
"shortDescription" : "Directory in which all created processes will run and create log files.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.use-spring-application-json",
"name" : "use-spring-application-json",
"type" : "java.lang.Boolean",
"description" : "Flag to indicate whether application properties are passed as command line args or in a SPRING_APPLICATION_JSON environment variable. Default value is {@code true}.",
"shortDescription" : "Flag to indicate whether application properties are passed as command line args or in a SPRING_APPLICATION_JSON environment variable.",
"defaultValue" : true,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.env-vars-to-inherit",
"name" : "env-vars-to-inherit",
"type" : "java.lang.String[]",
"description" : "Array of regular expression patterns for environment variables that should be passed to launched applications.",
"shortDescription" : "Array of regular expression patterns for environment variables that should be passed to launched applications.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.shutdown-timeout",
"name" : "shutdown-timeout",
"type" : "java.lang.Integer",
"description" : "Maximum number of seconds to wait for application shutdown. via the {@code /shutdown} endpoint. A timeout value of 0 specifies an infinite timeout. Default is 30 seconds.",
"shortDescription" : "Maximum number of seconds to wait for application shutdown. via the {@code /shutdown} endpoint.",
"defaultValue" : 30,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.maximum-concurrent-tasks",
"name" : "maximum-concurrent-tasks",
"type" : "java.lang.Integer",
"description" : "The maximum concurrent tasks allowed for this platform instance.",
"shortDescription" : "The maximum concurrent tasks allowed for this platform instance.",
"defaultValue" : 20,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.debug-suspend",
"name" : "debug-suspend",
"type" : "org.springframework.cloud.deployer.spi.local.LocalDeployerProperties$DebugSuspendType",
"description" : "Suspend defines whether the JVM should suspend and wait for a debugger to attach or not",
"shortDescription" : "Suspend defines whether the JVM should suspend and wait for a debugger to attach or not",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.java-opts",
"name" : "java-opts",
"type" : "java.lang.String",
"description" : "The Java Options to pass to the JVM, e.g -Dtest=foo",
"shortDescription" : "The Java Options to pass to the JVM, e.g -Dtest=foo",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.java-home-path",
"name" : "java-home-path",
"type" : "java.util.Map<java.lang.String,java.lang.String>",
"description" : null,
"shortDescription" : null,
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.inherit-logging",
"name" : "inherit-logging",
"type" : "java.lang.Boolean",
"description" : null,
"shortDescription" : null,
"defaultValue" : false,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.app-admin",
"name" : "app-admin",
"type" : "org.springframework.cloud.deployer.spi.app.AppAdmin",
"description" : null,
"shortDescription" : null,
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.debug-port",
"name" : "debug-port",
"type" : "java.lang.Integer",
"description" : "Set remote debugging port for JDK 8 runtimes. @deprecated Use the {@link #debugAddress} instead!",
"shortDescription" : "Set remote debugging port for JDK 8 runtimes.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.delete-files-on-exit",
"name" : "delete-files-on-exit",
"type" : "java.lang.Boolean",
"description" : "Whether to delete created files and directories on JVM exit.",
"shortDescription" : "Whether to delete created files and directories on JVM exit.",
"defaultValue" : true,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.hostname",
"name" : "hostname",
"type" : "java.lang.String",
"description" : "(optional) hostname to use when computing the URL of the deployed application. By default the {@link CommandBuilder} implementations decide how to build the hostname.",
"shortDescription" : "(optional) hostname to use when computing the URL of the deployed application.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.java-cmd",
"name" : "java-cmd",
"type" : "java.lang.String",
"description" : "The command to run java.",
"shortDescription" : "The command to run java.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.debug-address",
"name" : "debug-address",
"type" : "java.lang.String",
"description" : "Debugging address for the remote clients to attache to. Addresses have the format \"<name>:<port>\" where <name> is the host name and <port> is the socket port number at which it attaches or listens. For JDK 8 or earlier, the address consists of the port number alone (the host name is implicit to localhost). Example addresses for JDK version 9 or higher: <code>*:20075, 192.168.178.10:20075</code>. Example addresses for JDK version 8 or earlier: <code>20075</code>.",
"shortDescription" : "Debugging address for the remote clients to attache to.",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.port-range.high",
"name" : "high",
"type" : "java.lang.Integer",
"description" : "Upper bound for computing applications's random port.",
"shortDescription" : "Upper bound for computing applications's random port.",
"defaultValue" : 61000,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.port-range.low",
"name" : "low",
"type" : "java.lang.Integer",
"description" : "Lower bound for computing applications's random port.",
"shortDescription" : "Lower bound for computing applications's random port.",
"defaultValue" : 20000,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.health-probe.path",
"name" : "path",
"type" : "java.lang.String",
"description" : "Path to check as a probe",
"shortDescription" : "Path to check as a probe",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
}, {
"id" : "spring.cloud.deployer.local.startup-probe.path",
"name" : "path",
"type" : "java.lang.String",
"description" : "Path to check as a probe",
"shortDescription" : "Path to check as a probe",
"defaultValue" : null,
"hints" : {
"keyHints" : [ ],
"keyProviders" : [ ],
"valueHints" : [ ],
"valueProviders" : [ ]
},
"deprecation" : null,
"deprecated" : false
} ],
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/deployers/01bb2216-44bc-4621-abd2-0cc0d71389a5"
},
"deployer" : {
"href" : "http://localhost:7577/api/deployers/01bb2216-44bc-4621-abd2-0cc0d71389a5"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/deployers"
},
"profile" : {
"href" : "http://localhost:7577/api/profile/deployers"
},
"search" : {
"href" : "http://localhost:7577/api/deployers/search"
}
},
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
要返回的页面的大小 |
|
|
可用于分页的总元素 |
|
|
总页数 |
|
|
返回的页面的页码(从零开始) |
|
|
包含 Deployer 对象的数组 |
|
|
部署者名称 |
|
|
部署程序的类型(例如“本地”) |
|
|
提供一些部署程序属性的说明 |
|
|
包含 Deployer 部署属性的数组 |
|
|
部署属性 ID |
|
|
部署属性名称 |
|
|
部署属性类型 |
|
|
部署属性说明 |
|
|
部署属性简短说明 |
|
|
部署属性默认值 |
|
|
包含部署属性提示的对象 |
|
|
部署属性键提示 |
|
|
部署属性键提示提供程序 |
|
|
部署属性值提示 |
|
|
部署属性值提示提供程序 |
|
|
|
|
|
30.4. 软件包
Packages 资源是从 Spring Data Repository 导出的PackageMetadata
并由 Spring Data REST 公开。
30.4.1. 搜索
一个GET
request 将返回所有 Spring Cloud Skipper 包元数据的分页列表。
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 4613
{
"_embedded" : {
"packageMetadata" : [ {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/3"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/3{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/3"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/4"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/4{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/4"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/5"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/5{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/5"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/6"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/6{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/6"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata"
},
"profile" : {
"href" : "http://localhost:7577/api/profile/packageMetadata"
},
"search" : {
"href" : "http://localhost:7577/api/packageMetadata/search"
}
},
"page" : {
"size" : 10,
"totalElements" : 4,
"totalPages" : 1,
"number" : 0
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
要返回的页面的大小 |
|
|
可用于分页的总元素 |
|
|
总页数 |
|
|
返回的页面的页码(从零开始) |
|
|
包含包元数据项的集合 |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的仓库 ID |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
30.4.2. 搜索摘要
一个GET
request 返回可用包元数据的列表以及每个包的摘要信息。
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 2261
{
"_embedded" : {
"packageMetadata" : [ {
"version" : "1.0.0",
"description" : "The log sink uses the application logger to output the data for inspection.",
"iconUrl" : null,
"repositoryName" : "local",
"name" : "log",
"id" : "3",
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/3"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/3{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/3"
}
}
}, {
"version" : "1.0.0",
"description" : "The log sink uses the application logger to output the data for inspection.",
"iconUrl" : null,
"repositoryName" : "local",
"name" : "log",
"id" : "4",
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/4"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/4{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/4"
}
}
}, {
"version" : "1.0.0",
"description" : "The log sink uses the application logger to output the data for inspection.",
"iconUrl" : null,
"repositoryName" : "local",
"name" : "log",
"id" : "5",
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/5"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/5{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/5"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata?projection=summary"
},
"profile" : {
"href" : "http://localhost:7577/api/profile/packageMetadata"
},
"search" : {
"href" : "http://localhost:7577/api/packageMetadata/search"
}
},
"page" : {
"size" : 20,
"totalElements" : 3,
"totalPages" : 1,
"number" : 0
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
要返回的页面的大小 |
|
|
可用于分页的总元素 |
|
|
总页数 |
|
|
返回的页面的页码(从零开始) |
|
|
包元数据的标识符 |
|
|
图标的网址位置 |
|
|
此包所属的存储库名称。 |
|
|
包的版本 |
|
|
包的名称 |
|
|
包装简要说明 |
|
|
自链接 |
|
|
链接到完整的包元数据 |
|
|
安装包的链接 |
30.4.3. 使用详细信息进行搜索
一个GET
请求使用id
的包。
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
ETag: "0"
Content-Type: application/hal+json
Content-Length: 931
{
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/3"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/3{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/3"
}
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
30.4.4. 按包名称搜索
一个GET
请求返回给定包名称的所有 Spring Cloud Skipper 包元数据的列表。
请求结构
getPackageMetadataSearchFindByName
GET /api/packageMetadata/search/findByName?name=log HTTP/1.1
Host: localhost:7577
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 5404
{
"_embedded" : {
"packageMetadata" : [ {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/3"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/3{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/3"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/4"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/4{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/4"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/5"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/5{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/5"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/6"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/6{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/6"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/7"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/7{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/7"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/search/findByName?name=log"
}
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
30.4.5. 按包名称搜索,忽略大小写
一个GET
请求按给定的包名称返回所有 Spring Cloud Skipper 包元数据的列表,忽略大小写。
请求结构
GET /api/packageMetadata/search/findByNameContainingIgnoreCase?name=LO HTTP/1.1
Host: localhost:7577
请求示例
$ curl 'http://localhost:7577/api/packageMetadata/search/findByNameContainingIgnoreCase?name=LO' -i -X GET
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 2288
{
"_embedded" : {
"packageMetadata" : [ {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/3"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/3{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/3"
}
}
}, {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : 2,
"repositoryName" : "local",
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/4"
},
"packageMetadata" : {
"href" : "http://localhost:7577/api/packageMetadata/4{?projection}",
"templated" : true
},
"install" : {
"href" : "http://localhost:7577/api/package/install/4"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/packageMetadata/search/findByNameContainingIgnoreCase?name=LO"
}
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
30.5. 包
Package 资源映射到 PackageController 上,用于上传和安装包。
30.5.1. 上传
这upload
链接将包上传到local
数据库支持的存储库。
请求结构
POST /api/package/upload HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 163
Host: localhost:7577
{
"name" : "log",
"repoName" : "local",
"version" : "1.0.0",
"extension" : "zip",
"packageFileAsBytes" : "cGFja2FnZS55bWwKdGVtcGxhdGVzCnZhbHVlcy55bWwK"
}
请求示例
$ curl 'http://localhost:7577/api/package/upload' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json' \
-d '{
"name" : "log",
"repoName" : "local",
"version" : "1.0.0",
"extension" : "zip",
"packageFileAsBytes" : "cGFja2FnZS55bWwKdGVtcGxhdGVzCnZhbHVlcy55bWwK"
}'
响应结构
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 805
{
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null,
"links" : [ {
"rel" : "install",
"href" : "http://localhost:7577/api/package/install"
}, {
"rel" : "install",
"href" : "http://localhost:7577/api/package/install/{id}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
30.5.2. 安装
这install
链接可以安装一个包(由InstallRequest
) 进入目标平台。
请求结构
POST /api/package/install HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 296
Host: localhost:7577
{
"packageIdentifier" : {
"repositoryName" : "notused",
"packageName" : "log",
"packageVersion" : "1.0.0"
},
"installProperties" : {
"releaseName" : "test",
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"platformName" : "default"
}
}
请求示例
$ curl 'http://localhost:7577/api/package/install' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json' \
-d '{
"packageIdentifier" : {
"repositoryName" : "notused",
"packageName" : "log",
"packageVersion" : "1.0.0"
},
"installProperties" : {
"releaseName" : "test",
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"platformName" : "default"
}
}'
响应结构
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 2624
{
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"links" : [ {
"rel" : "status",
"href" : "http://localhost:7577/api/release/status/{name}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
指示存储库的来源(自由格式文本) |
|
|
此文件所基于的包索引规范版本 |
|
|
此包所属的仓库 ID |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
30.5.3. 使用 ID 安装
这install
link 可以将由其 ID 标识的包安装到目标平台中。
请求结构
POST /api/package/install/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 162
Host: localhost:7577
{
"releaseName" : "myLogReleaseWithInstallProperties",
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"platformName" : "default"
}
请求示例
$ curl 'http://localhost:7577/api/package/install/1' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json' \
-d '{
"releaseName" : "myLogReleaseWithInstallProperties",
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"platformName" : "default"
}'
响应结构
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 2633
{
"name" : "myLogRelease2",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"links" : [ {
"rel" : "status",
"href" : "http://localhost:7577/api/release/status/{name}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的仓库 ID |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
30.6. 存储库
Repositories 资源是从 Spring Data Repository 导出的RepositoryRepository
(是的,这是一个有趣的名字)并由 Spring Data REST 公开。
30.6.1. 查找全部
一个GET
request 返回所有 Spring Cloud Skipper 存储库的分页列表。
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 1288
{
"_embedded" : {
"repositories" : [ {
"name" : "test",
"url" : "classpath:/repositories/binaries/test",
"sourceUrl" : null,
"local" : false,
"description" : "test repository with a few packages",
"repoOrder" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/repositories/1"
},
"repository" : {
"href" : "http://localhost:7577/api/repositories/1"
}
}
}, {
"name" : "local",
"url" : "http://localhost:7577",
"sourceUrl" : null,
"local" : true,
"description" : "Default local database backed repository",
"repoOrder" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/repositories/2"
},
"repository" : {
"href" : "http://localhost:7577/api/repositories/2"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/repositories"
},
"profile" : {
"href" : "http://localhost:7577/api/profile/repositories"
},
"search" : {
"href" : "http://localhost:7577/api/repositories/search"
}
},
"page" : {
"size" : 10,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
要返回的页面的大小 |
|
|
可用于分页的总元素 |
|
|
总页数 |
|
|
返回的页面的页码(从零开始) |
|
|
包含存储库集合 |
|
|
存储库的名称 |
|
|
存储库的 URL |
|
|
存储库的源 URL |
|
|
存储库说明 |
|
|
存储库是本地的吗? |
|
|
存储库的顺序 |
30.6.2. 按名称查找
一个GET
request 返回单个 Spring Cloud Skipper 存储库。
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
ETag: "0"
Content-Type: application/hal+json
Content-Length: 366
{
"name" : "local",
"url" : "http://localhost:7577",
"sourceUrl" : null,
"local" : true,
"description" : "Default local database backed repository",
"repoOrder" : null,
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/repositories/2"
},
"repository" : {
"href" : "http://localhost:7577/api/repositories/2"
}
}
}
30.7. 版本
这release
资源从 Spring Data Repository 导出ReleaseRepository
并由 Spring Data REST 公开。
30.7.1. 查找全部
一个GET
请求返回所有 Spring Cloud Skipper 版本的分页列表。
响应结构
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json
Content-Length: 3321
{
"_embedded" : {
"releases" : [ {
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/releases/8"
},
"release" : {
"href" : "http://localhost:7577/api/releases/8"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:7577/api/releases"
},
"profile" : {
"href" : "http://localhost:7577/api/profile/releases"
},
"search" : {
"href" : "http://localhost:7577/api/releases/search"
}
},
"page" : {
"size" : 10,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
要返回的页面的大小 |
|
|
可用于分页的总元素 |
|
|
总页数 |
|
|
返回的页面的页码(从零开始) |
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
版本的平台名称 |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的仓库 ID |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
30.8. 发布
Release 资源映射到 ReleaseController 上,用于管理版本的生命周期。
30.8.1. 列表
最新列出
这list
链接可以列出状态为“已部署”或“失败”的最新版本。
响应结构
HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 2913
{
"_embedded" : {
"releases" : [ {
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"_links" : {
"status" : {
"href" : "http://localhost:7577/api/release/status/{name}",
"templated" : true
}
}
} ]
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的仓库 ID |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
按名称列出最新
这list
链接可以列出状态为已部署或失败的最新版本的版本
给定的发布名称。
响应结构
HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 2913
{
"_embedded" : {
"releases" : [ {
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"_links" : {
"status" : {
"href" : "http://localhost:7577/api/release/status/{name}",
"templated" : true
}
}
} ]
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的仓库 ID |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
30.8.2. 状态
获取版本的状态
这status
REST 端点提供最后一个已知版本的状态。
响应结构
HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 313
{
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null,
"_links" : {
"manifest" : {
"href" : "http://localhost:7577/api/release/manifest/{name}",
"templated" : true
}
}
}
按版本划分的状态
这status
REST 终结点可以提供特定发行版本的状态。
响应结构
HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 313
{
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null,
"_links" : {
"manifest" : {
"href" : "http://localhost:7577/api/release/manifest/{name}",
"templated" : true
}
}
}
30.8.3. 升级
升级版本
升级链接使用配置的包和配置值升级现有版本UpgradeRequest
.
请求结构
POST /api/release/upgrade HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 269
Host: localhost:7577
{
"packageIdentifier" : {
"packageName" : "log",
"packageVersion" : "1.1.0"
},
"upgradeProperties" : {
"releaseName" : "test",
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
}
},
"force" : false,
"appNames" : [ ]
}
请求示例
$ curl 'http://localhost:7577/api/release/upgrade' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json' \
-d '{
"packageIdentifier" : {
"packageName" : "log",
"packageVersion" : "1.1.0"
},
"upgradeProperties" : {
"releaseName" : "test",
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
}
},
"force" : false,
"appNames" : [ ]
}'
响应结构
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 2624
{
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"links" : [ {
"rel" : "status",
"href" : "http://localhost:7577/api/release/status/{name}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
30.8.4. 回滚
使用 uri 变量回滚释放
回滚链接将版本回滚到以前的版本或特定版本。
这部分 API 已弃用,请使用使用请求对象回滚发布。 |
响应结构
HTTP/1.1 201 Created
Content-Type: application/hal+json
Content-Length: 2650
{
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"_links" : {
"status" : {
"href" : "http://localhost:7577/api/release/status/{name}",
"templated" : true
}
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
使用请求对象回滚发布
回滚链接将版本回滚到以前的版本或特定版本。
请求结构
POST /api/release/rollback HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 66
Host: localhost:7577
{
"releaseName" : "test",
"version" : 1,
"timeout" : 60000
}
请求示例
$ curl 'http://localhost:7577/api/release/rollback' -i -X POST \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json' \
-d '{
"releaseName" : "test",
"version" : 1,
"timeout" : 60000
}'
响应结构
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 2624
{
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"links" : [ {
"rel" : "status",
"href" : "http://localhost:7577/api/release/status/{name}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
30.8.5. 清单
获取清单
这manifest
REST 终结点返回最后一个已知版本的清单。
请求结构
GET /api/release/manifest/test HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:7577
请求示例
$ curl 'http://localhost:7577/api/release/manifest/test' -i -X GET \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json'
响应结构
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 610
{
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n",
"links" : [ {
"rel" : "status",
"href" : "http://localhost:7577/api/release/status/{name}"
} ]
}
按版本获取清单
这manifest
REST 终结点可以返回特定发布版本的清单。
响应结构
HTTP/1.1 200 OK
Content-Type: application/hal+json
Content-Length: 636
{
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n",
"_links" : {
"status" : {
"href" : "http://localhost:7577/api/release/status/{name}",
"templated" : true
}
}
}
30.8.6. 删除
删除发布
您可以使用DELETE
请求删除现有版本。
删除作不会卸载与发行版对应的已上传包。
请求结构
DELETE /api/release/test HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:7577
请求示例
$ curl 'http://localhost:7577/api/release/test' -i -X DELETE \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Accept: application/json'
响应结构
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2624
{
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"links" : [ {
"rel" : "status",
"href" : "http://localhost:7577/api/release/status/{name}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
删除发布并卸载包
您可以使用 DELETE 请求删除现有版本并卸载与该版本对应的包,前提是没有其他处于活动状态的版本使用这些包。
请求结构
DELETE /api/release/test/package HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:7577
请求示例
$ curl 'http://localhost:7577/api/release/test/package' -i -X DELETE \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
响应结构
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2624
{
"name" : "test",
"version" : 1,
"info" : {
"status" : {
"statusCode" : "DELETED",
"platformStatus" : null
},
"firstDeployed" : null,
"lastDeployed" : null,
"deleted" : null,
"description" : null
},
"pkg" : {
"metadata" : {
"apiVersion" : "skipper.spring.io/v1",
"origin" : null,
"repositoryId" : null,
"repositoryName" : null,
"kind" : "SkipperPackageMetadata",
"name" : "log",
"displayName" : null,
"version" : "1.0.0",
"packageSourceUrl" : "https://github.com/spring-cloud-stream-app-starters/log/tree/v1.2.0.RC1",
"packageHomeUrl" : "https://cloud.spring.io/spring-cloud-stream-app-starters/",
"tags" : "logging, sink",
"maintainer" : "https://github.com/sobychacko",
"description" : "The log sink uses the application logger to output the data for inspection.",
"sha256" : null,
"iconUrl" : null
},
"templates" : [ {
"name" : "log.yml",
"data" : "apiVersion: skipper.spring.io/v1\nkind: SpringCloudDeployerApplication\nmetadata:\n name: log\n type: sink\nspec:\n resource: maven://org.springframework.cloud.stream.app:log-sink-rabbit\n resourceMetadata: maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:{{version}}\n version: {{version}}\n applicationProperties:\n server.port: 0\n {{#spec.applicationProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.applicationProperties.entrySet}}\n deploymentProperties:\n {{#spec.deploymentProperties.entrySet}}\n {{key}}: {{value}}\n {{/spec.deploymentProperties.entrySet}}\n"
} ],
"dependencies" : [ ],
"configValues" : {
"raw" : "# Default values for {{name}}\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates\nversion: 1.2.0.RC1\n"
},
"fileHolders" : [ ]
},
"configValues" : {
"raw" : "config2: value2\nconfig1: value1\n"
},
"manifest" : {
"data" : "\"apiVersion\": \"skipper.spring.io/v1\"\n\"kind\": \"SpringCloudDeployerApplication\"\n\"metadata\":\n \"name\": \"log\"\n \"type\": \"sink\"\n\"spec\":\n \"resource\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit\"\n \"resourceMetadata\": \"maven://org.springframework.cloud.stream.app:log-sink-rabbit:jar:metadata:1.2.0.RC1\"\n \"version\": \"1.2.0.RC1\"\n \"applicationProperties\":\n \"server.port\": \"0\"\n \"deploymentProperties\": !!null \"null\"\n"
},
"platformName" : "default",
"links" : [ {
"rel" : "status",
"href" : "http://localhost:7577/api/release/status/{name}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本 |
|
|
版本状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除版本的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此包所属的存储库名称。 |
|
|
使用什么类型的封装系统 |
|
|
包的名称 |
|
|
版本的显示名称 |
|
|
包的版本 |
|
|
此包的源代码位置 |
|
|
包的主页 |
|
|
用于搜索的逗号分隔的标记列表 |
|
|
谁在维护此包 |
|
|
包装简要说明 |
|
|
将使用 SHA256 哈希算法下载的包二进制文件的哈希值 |
|
|
图标的网址位置 |
|
|
名称是模板的类似路径的名称 |
|
|
数据是作为字符串数据的模板 |
|
|
此包所依赖的包 |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的杂项文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发布清单 |
|
|
版本的平台名称 |
30.8.7. 取消
取消发布
您可以使用POST
请求取消现有发布作。
请求结构
POST /api/release/cancel HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 36
Host: localhost:7577
{
"releaseName" : "myLogRelease"
}