Azure / go-autorest

This package implements an HTTP request pipeline suitable for use across multiple go-routines and provides the shared routines relied on by AutoRest generated Go code.
https://github.com/Azure/autorest.go/
Apache License 2.0
219 stars 175 forks source link

compute.DisksClient.CreateOrUpdate returns empty model after polling #222

Closed paulmey closed 6 years ago

paulmey commented 6 years ago

After polling for disk creation (or update), the response from polling is returned unchanged. The actual model appears to be in the "output" property in the object:

{
  "startTime": "2017-12-15T00:34:53.7912588+00:00",
  "endTime": "2017-12-15T00:34:53.9320151+00:00",
  "status": "Succeeded",
  "properties": {
    "output": {
  "properties": {
    "accountType": "Standard_LRS",
    "creationData": {
      "createOption": "FromImage",
      "imageReference": {
        "id": "/Subscriptions/11111111-2222-3333-4444-555555555555/Providers/Microsoft.Compute/Locations/westus/Publishers/Canonical/ArtifactTypes/VMImage/Offers/UbuntuServer/Skus/16.04-LTS/Versions/16.04.201712080"
      }
    },
    "timeCreated": "2017-12-14T23:04:53.363834+00:00",
    "provisioningState": "Succeeded",
    "diskState": "Unattached"
  },
  "type": "Microsoft.Compute/disks",
  "location": "westus",
  "id": "/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/paulmey-dev/providers/Microsoft.Compute/disks/TestDisk",
  "name": "TestDisk"
}
  },
  "name": "cc2ea823-ee87-4461-bb0e-8ae442af9a42"
}

Either don't return the model or read the output property instead of the root json object.

jhendrixMSFT commented 6 years ago

This has been fixed in the v12 SDK as the long-running operation now performs a GET on the final resource after completion. However the extra "output" node doesn't look correct, I am following up with the service team about that. Thanks for reporting this. :)