Azure / Azure/azure-libraries-for-java

How can I get async behavior out of the Fluent SDK?

Ouverte
#8 16 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
customer-reported Mgmt Question
Langage dominant
Java
Étoiles
97
Forks
102
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

_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_

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par suivre le chemin de provisionnement de VM CreateAsync de Fluent SDK et par examiner la discussion de l’issue concernant la sémantique d’achèvement attendue. Déterminez si le VM ID, l’adresse IP privée principale et le NIC ID demandés sont disponibles avant que la machine soit prête ; terminé signifie documenter ou implémenter un point de retour pris en charge qui corresponde à ces exigences.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
azure, java
Domaine
api, cloud
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.