Resource Groups - Create Or Update
创建或更新资源组。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}?api-version=2021-04-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._\(\)]+$ |
要创建或更新的资源组的名称。 可以包括字母数字、下划线、括号、连字符、句点(末尾除外)和与允许字符匹配的 Unicode 字符。 |
|
subscription
|
path | True |
string |
Microsoft Azure 订阅 ID。 |
|
api-version
|
query | True |
string |
用于此操作的 API 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| location | True |
string |
资源组的位置。 创建资源组后,无法更改它。 它必须是受支持的 Azure 位置之一。 |
| managedBy |
string |
管理此资源组的资源的 ID。 |
|
| properties |
资源组属性。 |
||
| tags |
object |
附加到资源组的标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
确定 - 返回有关新资源组的信息。 |
|
| 201 Created |
创建 - 返回有关新资源组的信息。 |
|
| Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Create or update a resource group
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group?api-version=2021-04-01
{
"location": "eastus"
}
示例响应
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group",
"name": "my-resource-group",
"location": "eastus",
"properties": {
"provisioningState": "Succeeded"
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group",
"name": "my-resource-group",
"location": "eastus",
"properties": {
"provisioningState": "Succeeded"
}
}
定义
| 名称 | 说明 |
|---|---|
|
Cloud |
资源管理请求的错误响应。 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误响应 |
|
Resource |
资源组信息。 |
|
Resource |
资源组属性。 |
CloudError
资源管理请求的错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误响应 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ResourceGroup
资源组信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源组的 ID。 |
| location |
string |
资源组的位置。 创建资源组后,无法更改它。 它必须是受支持的 Azure 位置之一。 |
| managedBy |
string |
管理此资源组的资源的 ID。 |
| name |
string |
资源组的名称。 |
| properties |
资源组属性。 |
|
| tags |
object |
附加到资源组的标记。 |
| type |
string |
资源组的类型。 |
ResourceGroupProperties
资源组属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| provisioningState |
string |
预配状态。 |