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

开始重新启动分区Start Partition Restart

此 API 会重启指定分区的部分或所有副本或者实例。This API will restart some or all replicas or instances of the specified partition.

此 API 可用于测试故障转移。This API is useful for testing failover.

如果用于针对无状态服务分区,RestartPartitionMode 必须是 AllReplicasOrInstances。If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances.

使用相同的 OperationId 调用 GetPartitionRestartProgress API 可获取进度。Call the GetPartitionRestartProgress API using the same OperationId to get the progress.

请求Request

方法Method 请求 URIRequest URI
POSTPOST /Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart?api-version=6.0&OperationId={OperationId}&RestartPartitionMode={RestartPartitionMode}&timeout={timeout}

参数Parameters

名称Name 类型Type 必选Required 位置Location
serviceId 字符串string Yes 路径Path
partitionId string (uuid) string (uuid) Yes 路径Path
api-version 字符串string Yes 查询Query
OperationId string (uuid) string (uuid) Yes 查询Query
RestartPartitionMode string (枚举) string (enum) Yes 查询Query
timeout 整数 (int64) integer (int64) No 查询Query

serviceId

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

服务的标识。The identity of the service. 此 ID 通常是不带 "fabric:" URI 方案的服务全名。This ID is typically the full name of the service without the 'fabric:' URI scheme. 从版本 6.0 开始,分层名称以“~”字符隔开。Starting from version 6.0, hierarchical names are delimited with the "~" character. 例如,如果服务名称为“fabric:/myapp/app1/svc1”,则 6.0 及更高版本中的服务标识为“myapp~app1~svc1”,在以前的版本中为“myapp/app1/svc1”。For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions.


partitionId

类型 : string (uuid) Type : string (uuid)
是否 必需 :是Required : Yes

分区的标识。The identity of the partition.


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.


OperationId

类型 : string (uuid) Type : string (uuid)
是否 必需 :是Required : Yes

用于标识此 API 的调用的 GUID。A GUID that identifies a call of this API. 这会传递到相应的 GetProgress APIThis is passed into the corresponding GetProgress API


RestartPartitionMode

类型 : string (枚举) Type : string (enum)
是否 必需 :是Required : Yes

描述要重新启动哪些分区。Describe which partitions to restart. 可能的值包括: "无效"、"AllReplicasOrInstances"、"OnlyActiveSecondaries"Possible values include: 'Invalid', 'AllReplicasOrInstances', 'OnlyActiveSecondaries'


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
202 (已接受)202 (Accepted) 202状态代码指示操作已接受。A 202 status code indicates the operation was accepted. 调用 GetPartitionRestartProgress API 获取进度。Call the GetPartitionRestartProgress API to get the progress.
所有其他状态代码All other status codes 详细的错误响应。The detailed error response.
FabricErrorFabricError