您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

获取子名称信息列表Get Sub Name Info List

枚举具有给定名称的所有 Service Fabric 名称。Enumerates all the Service Fabric names under a given name.

枚举具有给定名称的所有 Service Fabric 名称。Enumerates all the Service Fabric names under a given name. 如果 subnames 不适合页面,则返回一页结果和一个继续标记,该标记可用于获取下一页。If the subnames do not fit in a page, one page of results is returned as well as a continuation token, which can be used to get the next page. 查询不存在的名称将失败。Querying a name that doesn't exist will fail.

请求Request

方法Method 请求 URIRequest URI
GETGET /Names/{nameId}/$/GetSubNames?api-version=6.0&Recursive={Recursive}&ContinuationToken={ContinuationToken}&timeout={timeout}

参数Parameters

名称Name 类型Type 必选Required 位置Location
nameId 字符串string Yes 路径Path
api-version 字符串string Yes 查询Query
Recursive booleanboolean No 查询Query
ContinuationToken stringstring No 查询Query
timeout 整数 (int64) integer (int64) No 查询Query

nameId

类型 : stringType : string
是否 必需 :是Required : Yes

Service Fabric 名称,不包含 "Fabric:" URI 方案。The Service Fabric name, without the 'fabric:' URI scheme.


api-version

类型 : stringType : string
是否 必需 :是Required : Yes
默认6.0Default : 6.0

API 的版本。The version of the API. 此参数是必需的,其值必须是 "6.0"。This parameter is required and its value must be '6.0'.

Service Fabric REST API 版本基于引入或更改 API 的运行时版本。Service Fabric REST API version is based on the runtime version in which the API was introduced or was changed. Service Fabric 运行时支持 API 的多个版本。Service Fabric runtime supports more than one version of the API. 这是 API 的最新支持版本。This is the latest supported version of the API. 如果传递的 API 版本较低,则返回的响应可能与此规范中所述的响应不同。If a lower API version is passed, the returned response may be different from the one documented in this specification.

此外,运行时将接受高于当前版本的运行时最新支持版本的任何版本。Additionally the runtime accept any version that is higher than the latest supported version up to the current version of the runtime. 如果最新的 API 版本为6.0,则如果运行时为6.1,则为了更轻松地编写客户端,运行时将接受该 API 的版本6.1。So if the latest API version is 6.0, but if the runtime is 6.1, in order to make it easier to write the clients, the runtime will accept version 6.1 for that API. 但是,API 的行为将按记录的6.0 版本进行。However the behavior of the API will be as per the documented 6.0 version.


Recursive

类型 :布尔值Type : boolean
是否 必需 :否Required : No
默认falseDefault : false

允许指定所执行的搜索应是递归的。Allows specifying that the search performed should be recursive.


ContinuationToken

类型 : stringType : string
是否 必需 :否Required : No

继续标记参数用于获取下一组结果。The continuation token parameter is used to obtain next set of results. 如果单个响应无法容纳来自系统的结果,则 API 响应中包括含有非空值的继续标记。A continuation token with a non-empty value is included in the response of the API when the results from the system do not fit in a single response. 当此值传递到下一个 API 调用时,API 返回下一组结果。When this value is passed to the next API call, the API returns next set of results. 如果没有更多结果,则该继续标记不包含值。If there are no further results, then the continuation token does not contain a value. 不应将此参数的值进行 URL 编码。The value of this parameter should not be URL encoded.


timeout

类型 :整数 (int64) Type : integer (int64)
是否 必需 :否Required : No
默认60Default : 60
InclusiveMaximum4294967295InclusiveMaximum : 4294967295
InclusiveMinimum1InclusiveMinimum : 1

执行操作的服务器超时,以秒为单位。The server timeout for performing the operation in seconds. 此超时指定客户端可以等待请求的操作完成的持续时间。This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. 此参数的默认值为 60 秒。The default value for this parameter is 60 seconds.

响应Responses

HTTP 状态代码HTTP Status Code 说明Description 响应架构Response Schema
200 (正常)200 (OK) Service Fabric 名称的分页列表。A paged list of Service Fabric names.
PagedSubNameInfoListPagedSubNameInfoList
所有其他状态代码All other status codes 详细的错误响应。The detailed error response.
FabricErrorFabricError

示例Examples

获取子名称Get sub names

此示例演示如何获取给定 Service Fabric 名称的所有子名称的相关信息。This example shows how to get information about all sub names of a given Service Fabric name.

请求Request

GET http://localhost:19080/Names/samples/$/GetSubNames?api-version=6.0

200响应200 Response

正文Body
{
  "ContinuationToken": "",
  "IsConsistent": true,
  "SubNames": [
    "fabric:/samples/CalculatorApp",
    "fabric:/samples/mynames"
  ]
}

递归搜索子名称Recursively search sub names

此示例演示如何以递归方式获取给定 Service Fabric 名称的所有子名称的相关信息。This example shows how to recursively get information about all child sub names of a given Service Fabric name.

请求Request

GET http://localhost:19080/Names/samples/$/GetSubNames?api-version=6.0&Recursive=True

200响应200 Response

正文Body
{
  "ContinuationToken": "",
  "IsConsistent": true,
  "SubNames": [
    "fabric:/samples/apps",
    "fabric:/samples/data",
    "fabric:/samples/CalculatorApp",
    "fabric:/samples/CalculatorApp/CalculatorService",
    "fabric:/samples/CalculatorApp/CalculatorService/Name-1",
    "fabric:/samples/CalculatorApp/CalculatorService/Name-2",
    "fabric:/samples/mynames/name-1"
  ]
}

使用继续标记的页面Page using continuation token

此示例演示如何使用 ContinuationToken 参数逐页浏览给定 Service Fabric 名称下的子名称的相关信息。This example shows how to page through the information about sub names under a given Service Fabric name using ContinuationToken parameter. 此参数的值是从上一个查询(在本例中为上面显示的示例)提供的。The value of this parameter is provided from the previous query, in this case the example shown above. 响应包含剩余的两个结果和一个空的 ContinuationToken。The response contains the remaining two results and an empty ContinuationToken. 空的 ContinuationToken 指示其他结果不可用。The empty ContinuationToken indicates that additional results are not available.

请求Request

GET http://localhost:19080/Names/samples/$/GetSubNames?api-version=6.0&Recursive=True&ContinuationToken=fabric:/samples/apps/PersistentQueueApp$131439231986491349

200响应200 Response

正文Body
{
  "ContinuationToken": "",
  "IsConsistent": true,
  "SubNames": [
    "fabric:/samples/apps/VolatileQueueApp",
    "fabric:/samples/apps/NotepadApp"
  ]
}