创建 cloudPcOnPremisesConnectionCreate cloudPcOnPremisesConnection

命名空间:microsoft.graphNamespace: microsoft.graph

重要

Microsoft Graph /beta 中版本下的 API 可能会更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported. 若要确定 API 在 v1.0 中是否可用,请使用 版本选择 器。To determine whether an API is available in v1.0, use the Version selector.

创建新的 cloudPcOnPremisesConnection 对象,用于预配云电脑。Create a new cloudPcOnPremisesConnection object for provisioning cloud PCs.

重要

云电脑 API 处于预览阶段,当前仅适用于一组选定客户。The cloud PC API is in preview and is currently available only to a select group of customers.

权限Permissions

要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

权限类型Permission type 权限(从最低特权到最高特权)Permissions (from least to most privileged)
委派(工作或学校帐户)Delegated (work or school account) CloudPC.ReadWrite.AllCloudPC.ReadWrite.All
委派(个人 Microsoft 帐户)Delegated (personal Microsoft account) 不支持。Not supported.
应用程序Application 不支持。Not supported.

HTTP 请求HTTP request

POST /deviceManagement/virtualEndpoint/onPremisesConnections

请求标头Request headers

名称Name 说明Description
AuthorizationAuthorization Bearer {token}。必需。Bearer {token}. Required.
Content-TypeContent-Type application/json. Required.application/json. Required.

请求正文Request body

在请求正文中,提供 cloudPcOnPremisesConnection 对象的 JSON 表示形式。In the request body, supply a JSON representation of the cloudPcOnPremisesConnection object.

下表显示创建 cloudPcOnPremisesConnection时所需的属性。The following table shows the properties that are required when you create the cloudPcOnPremisesConnection.

属性Property 类型Type 说明Description
displayNamedisplayName StringString 本地显示名称的基础结构。The display name for the on-premises connection.
subscriptionIdsubscriptionId StringString 与租户关联的目标 Azure 订阅的 ID。The ID of the target Azure subscription that’s associated with your tenant.
adDomainNameadDomainName StringString 要加入的 Active Directory (的 FQDN) 完全限定域名。The fully qualified domain name (FQDN) of the Active Directory domain you want to join.
adDomainUsernameadDomainUsername StringString Active Directory 帐户的用户名 (拥有在 Active Directory) 创建计算机对象的权限的用户或服务帐户。The username of an Active Directory account (user or service account) that has permissions to create computer objects in Active Directory. 所需格式:admin@contoso.com。Required format: admin@contoso.com.
adDomainPasswordadDomainPassword StringString 与 adDomainUsername 关联的密码。The password associated with adDomainUsername.
resourceGroupIdresourceGroupId StringString 目标资源组的 ID。The ID of the target resource group. 必需格式:"/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}"。Required format: "/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}".
virtualNetworkIdvirtualNetworkId StringString 目标虚拟网络的 ID。The ID of the target virtual network. 必需格式:"/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}"。Required format: "/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}".
subnetIdsubnetId StringString 目标子网的 ID。The ID of the target subnet. 必需格式:"/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkId}/subnets/{subnetName}"。Required format: "/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkId}/subnets/{subnetName}".

响应Response

如果成功,此方法在响应正文中返回响应代码和 201 Created cloudPcOnPremisesConnection 对象。If successful, this method returns a 201 Created response code and a cloudPcOnPremisesConnection object in the response body.

示例Examples

请求Request

POST https://graph.microsoft.com/beta/deviceManagement/virtualEndpoint/onPremisesConnections
Content-Type: application/json
Content-length: 800

{
  "@odata.type": "#microsoft.graph.cloudPcOnPremisesConnection",
  "displayName": "Display Name value",
  "subscriptionId": "0ac520ee-14c0-480f-b6c9-0a90c585ffff",
  "subscriptionName": "Subscription Name value",
  "adDomainName": "Active Directory Domain Name value",
  "adDomainUsername": "Active Directory Domain User Name value",
  "organizationalUnit": "Organization Unit value",
  "resourceGroupId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG",
  "virtualNetworkId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet",
  "subnetId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default"
}

响应Response

注意: 下面是一个响应示例。Note: Here is an example of the response. 为简洁起见,可能会截断此处所示的响应对象。The response object shown here may be truncated for brevity. 将从实际调用中返回所有属性。All of the properties will be returned from an actual call.

HTTP/1.1 201 Created
Content-Type: application/json
Content-length: 897

{
  "@odata.type": "#microsoft.graph.cloudPcOnPremisesConnection",
  "id": "ac2ad805-167e-49ee-9bef-196c4ce7ffff",
  "displayName": "Display Name value",
  "subscriptionId": "0ac520ee-14c0-480f-b6c9-0a90c585ffff",
  "subscriptionName": "Subscription Name value",
  "adDomainName": "Active Directory Domain Name value",
  "adDomainUsername": "Active Directory Domain User Name value",
  "organizationalUnit": "Organization Unit value",
  "resourceGroupId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG",
  "virtualNetworkId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c58ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet",
  "subnetId": "/subscriptions/0ac520ee-14c0-480f-b6c9-0a90c585ffff/resourceGroups/ExampleRG/providers/Microsoft.Network/virtualNetworks/ExampleVNet/subnets/default",
  "healthCheckStatus": "pending"
}