你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Service Fabric 创建
创建或更新 Service Fabric 应用程序资源。
创建或更新具有指定名称的 Service Fabric 应用程序资源。
请求
方法 | 请求 URI |
---|---|
PUT | /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}?api-version=2017-07-01-preview |
参数
名称 | 类型 | 必须 | 位置 |
---|---|---|---|
subscriptionId | 字符串 | 是 | 路径 |
resourceGroupName | string | 是 | 路径 |
clusterName | string | 是 | 路径 |
applicationName | string | 是 | 路径 |
api-version | 字符串 | 是 | 查询 |
parameters | ApplicationResource | “是” | Body |
subscriptionId
类型:字符串
必需:是
客户订阅标识符。
resourceGroupName
类型:字符串
必需:是
资源组的名称。
clusterName
类型:字符串
必需:是
群集资源的名称。
applicationName
类型:字符串
必需:是
应用程序资源的名称。
api-version
类型:字符串
必需:是
默认值:2017-07-01-preview
Service Fabric 资源提供程序 API 的版本。 这是必需参数,对于此规范,其值必须为“2017-07-01-preview”。
parameters
类型: ApplicationResource
必需:是
应用程序资源。
响应
HTTP 状态代码 | 说明 | 响应架构 |
---|---|---|
202 (已接受) | 请求已接受,操作将以异步方式完成。 |
ApplicationResource |
所有其他状态代码 | 详细的错误响应。 |
ErrorModel |
示例
使用最小参数放置应用程序
请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp?api-version=2017-07-01-preview
正文
{
"type": "applications",
"location": "eastus",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp",
"name": "myCluster",
"tags": {},
"properties": {
"typeName": "myAppType",
"typeVersion": "1.0",
"removeApplicationCapacity": false
}
}
202 响应
标头
Retry-After: 10
Location: http://10.91.140.224/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/operationResults/5dce62ce-439b-47af-81d8-99ab14708e91?api-version=2017-07-01-preview
正文
{
"type": "applications",
"location": "eastus",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp",
"name": "myCluster",
"tags": {},
"etag": "W/\"636462502180261857\"",
"properties": {
"provisioningState": "Updating",
"typeName": "myAppType",
"typeVersion": "1.0",
"removeApplicationCapacity": false
}
}
放置具有最大参数的应用程序
请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp?api-version=2017-07-01-preview
正文
{
"type": "applications",
"location": "eastus",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp",
"name": "myCluster",
"tags": {},
"properties": {
"typeName": "myAppType",
"typeVersion": "1.0",
"parameters": {
"param1": "value1"
},
"upgradePolicy": {
"applicationHealthPolicy": {
"considerWarningAsError": true,
"maxPercentUnhealthyDeployedApplications": "0",
"defaultServiceTypeHealthPolicy": {
"maxPercentUnhealthyServices": "0",
"maxPercentUnhealthyPartitionsPerService": "0",
"maxPercentUnhealthyReplicasPerPartition": "0"
}
},
"rollingUpgradeMonitoringPolicy": {
"failureAction": "Rollback",
"healthCheckRetryTimeout": "00:10:00",
"healthCheckWaitDuration": "00:02:00",
"healthCheckStableDuration": "00:05:00",
"upgradeDomainTimeout": "1.06:00:00",
"upgradeTimeout": "01:00:00"
},
"upgradeReplicaSetCheckTimeout": "01:00:00",
"forceRestart": false
},
"maximumNodes": "3",
"minimumNodes": "1",
"removeApplicationCapacity": false,
"metrics": [
{
"name": "metric1",
"reservationCapacity": "1",
"maximumCapacity": "3",
"totalApplicationCapacity": "5"
}
]
}
}
202 响应
标头
Retry-After: 10
Location: http://10.91.140.224/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/operationResults/9c2ce367-47ea-43de-b69e-c5a423da4557?api-version=2017-07-01-preview
正文
{
"type": "applications",
"location": "eastus",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp",
"name": "myCluster",
"tags": {},
"etag": "W/\"636462502180261859\"",
"properties": {
"provisioningState": "Updating",
"typeName": "myAppType",
"typeVersion": "1.0",
"parameters": {
"param1": "value1"
},
"upgradePolicy": {
"applicationHealthPolicy": {
"considerWarningAsError": true,
"maxPercentUnhealthyDeployedApplications": "0",
"defaultServiceTypeHealthPolicy": {
"maxPercentUnhealthyServices": "0",
"maxPercentUnhealthyPartitionsPerService": "0",
"maxPercentUnhealthyReplicasPerPartition": "0"
}
},
"rollingUpgradeMonitoringPolicy": {
"failureAction": "Rollback",
"healthCheckRetryTimeout": "00:10:00",
"healthCheckWaitDuration": "00:02:00",
"healthCheckStableDuration": "00:05:00",
"upgradeDomainTimeout": "1.06:00:00",
"upgradeTimeout": "01:00:00"
},
"upgradeReplicaSetCheckTimeout": "01:00:00",
"forceRestart": false
},
"maximumNodes": "3",
"minimumNodes": "1",
"removeApplicationCapacity": false,
"metrics": [
{
"name": "metric1",
"reservationCapacity": "1",
"maximumCapacity": "3",
"totalApplicationCapacity": "5"
}
]
}
}