Azure / Azure/azure-libraries-for-java
How can I get async behavior out of the Fluent SDK?
- 主要语言
- Java
- 星标
- 97
- 派生
- 102
- PR 合并指标
- 30 天内没有已合并 PR
描述
_From @awesley on June 23, 2017 19:25_
Hiya,
I'm creating VMs using the Fluent SDK. Here's a code snippet:
```
var vm = await this.azure
.VirtualMachines
.Define(vmName)
.WithRegion(region)
.WithExistingResourceGroup(resourceGroupName)
.WithExistingPrimaryNetwork(network)
.WithSubnet(subNetName)
.WithPrimaryPrivateIPAddressDynamic()
.WithoutPrimaryPublicIPAddress()
.WithWindowsCustomImage(image)
.WithAdminUsername(adminUserName)
.WithAdminPassword(adminPassword)
.WithSize(vmSize)
.WithNewStorageAccount(storageAccountName)
.WithTag(TagKeyNames.StorageAccountId, storageAccount.Id)
.CreateAsync();
```
This task does not complete until the machine is entirely provisioned and booting - a period of over ten minutes. That doesn't seem async to me. Is there something I am doing wrong? I want the call to return prior to the machine's availability.
For comparison, when provisioning a VM on Amazon EC2 returns nearly immediately, well before the machine is fully provisioned and booted.
I need from the call is the Id (`vm.Id`), the Primary Private IP (`vm.GetPrimaryNetworkInterface().PrimaryPrivateIP`), and the primary NIC Id (`vm.PrimaryNetworkInterfaceId`). I do not need the machine to be ready.
Thanks!
_Copied from original issue: Azure/azure-sdk-for-net#3411_
贡献指南
调研方向
首先跟踪 Fluent SDK 的 VM CreateAsync 配置路径,并查看 issue 讨论以了解预期的完成语义。确定请求的 VM ID、主私有 IP 和 NIC ID 是否在机器准备就绪之前可用;完成意味着记录或实现一个符合这些要求的受支持返回点。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- azure, java
- 领域
- api, cloud
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100