通过


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

Guest Agents - Create

实现 GuestAgent PUT 方法。
创建或更新 GuestAgent。

PUT https://management.azure.com/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default?api-version=2025-03-13

URI 参数

名称 必需 类型 说明
resourceUri
path True

string

资源的完全限定的 Azure 资源管理器标识符。

api-version
query True

string

minLength: 1

要用于此作的 API 版本。

请求正文

名称 类型 说明
properties.credentials

GuestCredential

用于预配来宾代理的用户名/密码凭据。

properties.httpProxyConfig

HttpProxyConfiguration

VM 的 HTTP 代理配置。

properties.privateLinkScopeResourceId

string (arm-id)

此计算机分配到的专用链接范围的资源 ID(如果有)。

properties.provisioningAction

ProvisioningAction

获取或设置来宾代理预配操作。

响应

名称 类型 说明
200 OK

GuestAgent

资源“GuestAgent”更新操作成功

201 Created

GuestAgent

资源“GuestAgent”创建操作成功

标头

Retry-After: integer

Other Status Codes

ErrorResponse

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

GuestAgents_Create_MaximumSet
GuestAgents_Create_MinimumSet

GuestAgents_Create_MaximumSet

示例请求

PUT https://management.azure.com/gtgclehcbsyave/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default?api-version=2025-03-13

{
  "properties": {
    "credentials": {
      "username": "jqxuwirrcpfv",
      "password": "gkvbnmuahumuoibvscoxzfdqwvfuf"
    },
    "httpProxyConfig": {
      "httpsProxy": "uoyzyticmohohomlkwct"
    },
    "provisioningAction": "install"
  }
}

示例响应

{
  "properties": {
    "uuid": "hbsgztyakewtgbuxbesezncnzu",
    "credentials": {
      "username": "jqxuwirrcpfv"
    },
    "httpProxyConfig": {
      "httpsProxy": "uoyzyticmohohomlkwct"
    },
    "provisioningAction": "install",
    "status": "jpoukrzfenzrmjdahimkl",
    "customResourceName": "mhqymxkapuvsugd",
    "provisioningState": "Succeeded",
    "privateLinkScopeResourceId": "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkResourceName"
  },
  "id": "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default",
  "name": "rwecpthzyt",
  "type": "dkcgcbtlwtsedxzhvtu",
  "systemData": {
    "createdBy": "p",
    "createdByType": "User",
    "createdAt": "2024-01-29T22:28:00.094Z",
    "lastModifiedBy": "goxcwpyyqlxndquly",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-01-29T22:28:00.095Z"
  }
}
Azure-AsyncOperation: https://contoso.com/operationstatus
{
  "properties": {
    "uuid": "hbsgztyakewtgbuxbesezncnzu",
    "credentials": {
      "username": "jqxuwirrcpfv"
    },
    "httpProxyConfig": {
      "httpsProxy": "uoyzyticmohohomlkwct"
    },
    "provisioningAction": "install",
    "status": "jpoukrzfenzrmjdahimkl",
    "customResourceName": "mhqymxkapuvsugd",
    "provisioningState": "Succeeded",
    "privateLinkScopeResourceId": "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkResourceName"
  },
  "id": "/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default",
  "name": "rwecpthzyt",
  "type": "dkcgcbtlwtsedxzhvtu",
  "systemData": {
    "createdBy": "p",
    "createdByType": "User",
    "createdAt": "2024-01-29T22:28:00.094Z",
    "lastModifiedBy": "goxcwpyyqlxndquly",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-01-29T22:28:00.095Z"
  }
}

GuestAgents_Create_MinimumSet

示例请求

PUT https://management.azure.com/gtgclehcbsyave/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default?api-version=2025-03-13

{}

示例响应

{}
Azure-AsyncOperation: https://contoso.com/operationstatus
{}

定义

名称 说明
createdByType

创建资源的标识的类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

GuestAgent

定义 GuestAgent。

GuestCredential

用于连接到来宾的用户名/密码凭据。

HttpProxyConfiguration

VM 的 HTTP 代理配置。

ProvisioningAction

来宾代理预配操作。

ProvisioningState

资源的预配状态。

systemData

与创建和上次修改资源相关的元数据。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

GuestAgent

定义 GuestAgent。

名称 类型 说明
id

string (arm-id)

资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

资源的名称

properties.credentials

GuestCredential

用于预配来宾代理的用户名/密码凭据。

properties.customResourceName

string

获取 Kubernetes 中相应资源的名称。

properties.httpProxyConfig

HttpProxyConfiguration

VM 的 HTTP 代理配置。

properties.privateLinkScopeResourceId

string (arm-id)

此计算机分配到的专用链接范围的资源 ID(如果有)。

properties.provisioningAction

ProvisioningAction

获取或设置来宾代理预配操作。

properties.provisioningState

ProvisioningState

资源的预配状态。

properties.status

string

获取来宾代理状态。

properties.uuid

string

获取此资源的唯一标识符。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

type

string

资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

GuestCredential

用于连接到来宾的用户名/密码凭据。

名称 类型 说明
password

string (password)

获取或设置与来宾连接的密码。

username

string

获取或设置用于与来宾连接的用户名。

HttpProxyConfiguration

VM 的 HTTP 代理配置。

名称 类型 说明
httpsProxy

string

获取或设置 httpsProxy URL。

ProvisioningAction

来宾代理预配操作。

说明
install

安装来宾代理。

uninstall

卸载来宾代理。

repair

修复来宾代理。

ProvisioningState

资源的预配状态。

说明
Succeeded

已创建资源。

Failed

资源创建失败。

Canceled

资源创建已取消。

Provisioning

资源正在预配。

Updating

资源正在更新。

Deleting

正在删除资源。

Accepted

资源已被接受。

Created

已创建资源。

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳 (UTC) 。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。