你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

按名称获取服务类型信息

获取有关 Service Fabric 群集中预配的应用程序类型支持的特定服务类型的信息。

获取有关 Service Fabric 群集中预配的应用程序类型支持的特定服务类型的信息。 提供的应用程序类型必须存在。 否则,将返回 404 状态。 如果在群集中找不到指定的服务类型,则返回 204 响应。

请求

方法 请求 URI
GET /ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}?api-version=6.0&ApplicationTypeVersion={ApplicationTypeVersion}&timeout={timeout}

参数

名称 类型 必须 位置
applicationTypeName string 路径
serviceTypeName 字符串 路径
api-version 字符串 查询
ApplicationTypeVersion 字符串 查询
timeout 整数 (int64) 查询

applicationTypeName

类型:字符串
必需:是

应用程序类型的名称。


serviceTypeName

类型:字符串
必需:是

指定 Service Fabric 服务类型的名称。


api-version

类型:字符串
必需:是
默认

API 的版本。 此参数是必需的,其值必须为“6.0”。

Service Fabric REST API 版本基于引入或更改 API 的运行时版本。 Service Fabric 运行时支持 API 的多个版本。 这是 API 支持的最新版本。 如果传递的 API 版本较低,则返回的响应可能与本规范中所述的响应不同。

此外,运行时接受高于当前运行时版本支持的最新版本的任何版本。 因此,如果最新的 API 版本为 6.0,但如果运行时为 6.1,为了便于编写客户端,运行时将接受该 API 的版本 6.1。 但是,API 的行为将按照记录的 6.0 版本。


ApplicationTypeVersion

类型:字符串
必需:是

应用程序类型的版本。


timeout

类型:整数 (int64)
必需:否
默认
InclusiveMaximum4294967295
InclusiveMinimum1

执行操作的服务器超时,以秒为单位。 此超时指定客户端可以等待请求的操作完成的持续时间。 此参数的默认值为 60 秒。

响应

HTTP 状态代码 说明 响应架构
200 (正常) 预配的应用程序类型支持的特定服务类型。
ServiceTypeInfo
204 (NoContent) 如果在群集中找不到指定的服务类型,则返回 204 响应。
所有其他状态代码 详细的错误响应。
FabricError

示例

获取有关所有节点的信息。

此示例演示如何获取有关特定服务类型的信息。 如果在群集中找不到指定的服务类型,则返回 204 响应。

请求

GET http://localhost:19080/ApplicationTypes/Application2Type/$/GetServiceTypes/Actor1ActorServiceType?api-version=6.0&ApplicationTypeVersion=1.0.0

200 响应

正文
{
  "ServiceTypeDescription": {
    "IsStateful": true,
    "ServiceTypeName": "Actor1ActorServiceType",
    "PlacementConstraints": "",
    "HasPersistedState": true,
    "Kind": "Stateful",
    "Extensions": [
      {
        "Key": "__GeneratedServiceType__",
        "Value": "<GeneratedNames xmlns=\"http://schemas.microsoft.com/2015/03/fabact-no-schema\">\r\n            <DefaultService Name=\"Actor1ActorService\" />\r\n            <ReplicatorEndpoint Name=\"Actor1ActorServiceReplicatorEndpoint\" />\r\n            <ReplicatorConfigSection Name=\"Actor1ActorServiceReplicatorConfig\" />\r\n            <ReplicatorSecurityConfigSection Name=\"Actor1ActorServiceReplicatorSecurityConfig\" />\r\n            <StoreConfigSection Name=\"Actor1ActorServiceLocalStoreConfig\" />\r\n            <ServiceEndpointV2 Name=\"Actor1ActorServiceEndpointV2\" />\r\n          </GeneratedNames>"
      }
    ],
    "LoadMetrics": [],
    "ServicePlacementPolicies": []
  },
  "ServiceManifestVersion": "1.0.0",
  "ServiceManifestName": "Actor1Pkg",
  "IsServiceGroup": false
}

204 响应

正文

响应正文为空。