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) 格式的超文本应用程序。
链接可以在密钥下方找到。
API 的使用者不应自行创建 URI。
相反,他们应该使用资源中的链接进行导航。_links
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. 服务器
Server 资源公开了 Server 的构建和版本信息。
30.2.1. 服务器信息
请求返回 Spring Cloud Skipper 的元信息,包括以下内容:GET
-
服务器名称 — 通常
spring-cloud-skipper-server
-
服务器的版本 — 例如
2.11.5
30.3. 平台
平台(或 Platform Deployer)资源从 Spring Data Repository 导出,并由 Spring Data REST 公开。DeployerRepository
30.3.1. 查找全部
请求返回所有 Spring Cloud Skipper 平台部署程序的分页列表。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: 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
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
返回的页面大小 |
|
|
可用于分页的元素总数 |
|
|
总页数 |
|
|
返回的页面的页码(从 0 开始) |
|
|
包含 Deployer 对象的数组 |
|
|
部署程序的名称 |
|
|
部署程序的类型(例如,“local”) |
|
|
提供一些 Deployer 属性的描述 |
|
|
包含 Deployer 部署属性的数组 |
|
|
部署属性 ID |
|
|
部署属性名称 |
|
|
部署属性类型 |
|
|
部署属性说明 |
|
|
部署属性简短描述 |
|
|
部署属性默认值 |
|
|
包含部署属性提示的对象 |
|
|
部署属性键提示 |
|
|
部署属性键提示提供程序 |
|
|
部署属性值提示 |
|
|
部署属性值提示提供程序 |
|
|
|
|
|
30.4. 软件包
Packages 资源从 Spring Data Repository 导出,并由 Spring Data REST 公开。PackageMetadata
30.4.1. 搜索
请求将返回所有 Spring Cloud Skipper 包元数据的分页列表。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: 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
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
返回的页面大小 |
|
|
可用于分页的元素总数 |
|
|
总页数 |
|
|
返回的页面的页码(从 0 开始) |
|
|
包含 Package Metadata 项的集合 |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
30.4.2. 搜索摘要
请求返回可用包元数据的列表以及每个包的摘要信息。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: 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
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
返回的页面大小 |
|
|
可用于分页的元素总数 |
|
|
总页数 |
|
|
返回的页面的页码(从 0 开始) |
|
|
包元数据的标识符 |
|
|
图标的 URL 位置 |
|
|
此 Package 所属的存储库名称。 |
|
|
软件包的版本 |
|
|
包的名称 |
|
|
包装的简要描述 |
|
|
自链接 |
|
|
链接到完整的包元数据 |
|
|
用于安装软件包的链接 |
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"
}
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
30.4.4. 按 Package Name 搜索
请求返回给定包名称的所有 Spring Cloud Skipper 包元数据的列表。GET
请求结构
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"
}
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
30.4.5. 按 package name 搜索,忽略大小写
请求按给定的包名称返回所有 Spring Cloud Skipper 包元数据的列表,忽略大小写。GET
请求结构
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 Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
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}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库 nane。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
包的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 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}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本版本 |
|
|
发布状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
指示存储库的来源(自由格式文本) |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
此包所属的存储库 ID |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发行版的清单 |
|
|
版本的平台名称 |
30.5.3. 使用 ID 安装
该链接可以将由其 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}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本版本 |
|
|
发布状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发行版的清单 |
|
|
版本的平台名称 |
30.6. 存储库
Repositories 资源是从 Spring Data Repository 导出的(是的,这是一个有趣的名字),并由 Spring Data REST 公开。RepositoryRepository
30.6.1. 查找全部
请求返回所有 Spring Cloud Skipper 存储库的分页列表。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: 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
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
返回的页面大小 |
|
|
可用于分页的元素总数 |
|
|
总页数 |
|
|
返回的页面的页码(从 0 开始) |
|
|
包含存储库的集合 |
|
|
存储库的名称 |
|
|
存储库的 URL |
|
|
存储库的源 URL |
|
|
存储库描述 |
|
|
存储库是本地的吗? |
|
|
存储库的顺序 |
30.6.2. 按名称查找
请求返回单个 Spring Cloud Skipper 存储库。GET
响应结构
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. 发行版
资源从 Spring Data Repository 导出,并由 Spring Data REST 公开。release
ReleaseRepository
30.7.1. 查找全部
请求返回所有 Spring Cloud Skipper 版本的分页列表。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: 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
}
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
分页属性 |
|
|
返回的页面大小 |
|
|
可用于分页的元素总数 |
|
|
总页数 |
|
|
返回的页面的页码(从 0 开始) |
|
|
版本名称 |
|
|
版本版本 |
|
|
发布状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
版本的平台名称 |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发行版的清单 |
|
|
版本的平台名称 |
30.8. 发布
Release 资源映射到 ReleaseController 上,用于管理发布的生命周期。
30.8.1. 列表
列出最新
该链接可以列出状态为 deployed 或 failed 的最新版本的版本。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) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发行版的清单 |
|
|
版本的平台名称 |
按名称列出最新内容
该链接可以列出最新版本的版本,其状态为 deployed 或 failed。
给定的版本名称。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) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发行版的清单 |
|
|
版本的平台名称 |
30.8.2. 状态
获取发布状态
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
}
}
}
按版本划分的状态
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}"
} ]
}
响应字段
路径 | 类型 | 描述 |
---|---|---|
|
|
版本名称 |
|
|
版本版本 |
|
|
发布状态的 StatusCode (UNKNOWN、DEPLOYED、DELETED、FAILED) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发行版的清单 |
|
|
版本的平台名称 |
30.8.4. 回滚
使用 uri 变量回滚版本
回滚链接将发行版回滚到以前的发行版或特定发行版。
这部分 api 已废弃,请使用 使用 request 对象的 Rollback release。 |
响应结构
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) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 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) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 YAML 字符串 |
|
|
包中的其他文件,例如 README、LICENSE 等。 |
|
|
配置值的原始 YAML 字符串 |
|
|
发行版的清单 |
|
|
版本的平台名称 |
30.8.5. 清单
获取清单
REST 终端节点返回最后一个已知发行版的清单。manifest
请求结构
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}"
} ]
}
按版本获取清单
REST 终端节点可以返回特定发行版的清单。manifest
响应结构
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) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 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) |
|
|
来自底层平台的状态 |
|
|
首次部署的日期/时间 |
|
|
上次部署的日期/时间 |
|
|
删除发布的日期/时间 |
|
|
关于此版本的人性化“日志条目” |
|
|
此文件所基于的 Package Index spec 版本 |
|
|
指示存储库的来源(自由格式文本) |
|
|
此包所属的存储库 ID。 |
|
|
此 Package 所属的存储库名称。 |
|
|
正在使用的软件包系统类型 |
|
|
包的名称 |
|
|
发行版的显示名称 |
|
|
软件包的版本 |
|
|
此包源代码的位置 |
|
|
包的主页 |
|
|
用于搜索的标记的逗号分隔列表 |
|
|
谁在维护此包 |
|
|
包装的简要描述 |
|
|
将使用 SHA256 哈希算法下载的软件包二进制文件的哈希值 |
|
|
图标的 URL 位置 |
|
|
Name 是模板的路径式名称 |
|
|
data 是作为字符串数据的模板 |
|
|
此 package 所依赖的 package |
|
|
配置值的原始 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"
}