REST API 指南
本节介绍了Spring Cloud Skipper REST API。
29. 概述
Spring Cloud Skipper 提供了一个 REST API,允许您访问服务器的所有方面。<br/>Spring Cloud Skipper shell 是该 API 的首选使用者。
29.1. HTTP 方法
Spring Cloud Skipper 尽可能遵循标准HTTP和REST约定中的HTTP动词使用。<br/>下表显示了每个动词以及Skipper如何使用它们:
| 动词 | 用法 |
|---|---|
|
用于检索资源。 |
|
用于创建新资源。 |
|
用于更新现有资源,包括部分更新。 |
|
用于删除现有资源。 |
29.2. HTTP状态码
跳板器在其使用HTTP状态码时,尽可能遵循标准的HTTP和REST约定。<br/>下表显示了每个状态及其在跳板器中的含义:
| 状态码 | 用法 |
|---|---|
|
请求已成功完成。 |
|
已成功创建新资源。
资源的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会返回Spring Cloud Skipper的元信息,包括以下内容:
-
服务器名称——通常为
spring-cloud-skipper-server -
服务器版本 —— 例如,
2.11.5
30.3. 平台
平台(或平台部署程序)资源是从 Spring Data 存储库 DeployerRepository 导出并由 Spring Data REST 暴露的。
30.3.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: 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
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
分页属性 |
|
|
正在返回的页面大小 |
|
|
分页可用的总元素 |
|
|
页面总数 |
|
|
页面编号(从零开始) |
|
|
包含部署程序对象的数组 |
|
|
部署者姓名 |
|
|
部署器类型(例如 'local') |
|
|
描述提供一些部署器属性 |
|
|
包含部署程序部署属性的数组 |
|
|
部署属性 id |
|
|
部署属性名称 |
|
|
部署属性类型 |
|
|
部署属性说明 |
|
|
部署属性简短描述 |
|
|
部署属性默认值 |
|
|
包含部署属性提示的对象 |
|
|
部署属性键提示 |
|
|
部署属性键提示提供程序 |
|
|
部署属性值提示 |
|
|
部署属性值提示提供程序 |
|
|
|
|
|
30.4. 包
软件包资源从 Spring Data 存储库 PackageMetadata 导出,并由 Spring Data REST 提供服务。
30.4.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: 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哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
30.4.2. 搜索摘要
请求返回 0 列表中包含每个包的摘要信息。
响应结构
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
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
分页属性 |
|
|
正在返回的页面大小 |
|
|
分页可用的总元素 |
|
|
页面总数 |
|
|
页面编号(从零开始) |
|
|
软件包元数据的标识符 |
|
|
图标的URL位置 |
|
|
此包所属存储库的名称。 |
|
|
软件包的版本 |
|
|
包的名称 |
|
|
包的简短描述 |
|
|
自链接 |
|
|
链接到完整的包元数据 |
|
|
安装该包的链接 |
30.4.3. 带详细信息的搜索
A 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"
}
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
30.4.4. 根据包名称搜索
一个 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: 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"
}
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
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"
}
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
30.5 包
包资源映射到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}"
} ]
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
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}"
} ]
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
指示存储库的来源(自由格式文本) |
|
|
此文件基于的软件包索引规范版本 |
|
|
此包所属的存储库ID |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始YAML字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始YAML字符串 |
|
|
发布的清单 |
|
|
发布版的平台名称 |
30.5.3. 使用 ID 安装
编号为install的链接可以将包安装到目标平台上。
请求结构
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}"
} ]
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库ID |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始YAML字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始YAML字符串 |
|
|
发布的清单 |
|
|
发布版的平台名称 |
版本30.6.存储库
存储库资源是从Spring Data Repository RepositoryRepository(是的,它的名字很有趣)导出,并通过Spring Data REST公开。
30.6.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: 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 请求返回单个 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
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
分页属性 |
|
|
正在返回的页面大小 |
|
|
分页可用的总元素 |
|
|
页面总数 |
|
|
页面编号(从零开始) |
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
发布版的平台名称 |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库ID |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始YAML字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始YAML字符串 |
|
|
发布的清单 |
|
|
发布版的平台名称 |
30.8 版本发布
发行版资源映射到 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
}
}
} ]
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库ID |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始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
}
}
} ]
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库ID |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始YAML字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始YAML字符串 |
|
|
发布的清单 |
|
|
发布版的平台名称 |
30.8.2. 状态
获取发布状态
该statusREST端点提供了上一个已知发布版本的状态。
响应结构
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
}
}
}
按版本状态
REST 端点 status 可以为特定发布版本提供状态。
响应结构
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}"
} ]
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始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
}
}
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始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}"
} ]
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始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}"
} ]
}
通过版本获取清单
该manifestREST端点可以返回特定版本的清单文件。
响应结构
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}"
} ]
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始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}"
} ]
}
响应字段
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
发布名称 |
|
|
发行版本 |
|
|
发布状态的HTTP响应码(UNKNOWN,DEPLOYED,DELETED,FAILED) |
|
|
底层平台的状态 |
|
|
首次部署的时间/日期 |
|
|
上次部署的时间/日期 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人类友好的“日志条目” |
|
|
此文件基于的软件包索引规范版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此 Package 所属的仓库 ID。 |
|
|
此包所属存储库的名称。 |
|
|
正在使用哪种类型的包系统 |
|
|
包的名称 |
|
|
发布版本的显示名称 |
|
|
软件包的版本 |
|
|
此包的源代码位置 |
|
|
该软件包的首页 |
|
|
用于搜索的标签列表,用逗号分隔 |
|
|
谁在维护这个包 |
|
|
包的简短描述 |
|
|
使用SHA256哈希算法下载包二进制文件的哈希值 |
|
|
图标的URL位置 |
|
|
名称是模板的路径式名称 |
|
|
数据是字符串模板 |
|
|
此包所依赖的软件包 |
|
|
配置值的原始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"
}