Azure / azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
https://docs.microsoft.com/azure/developer/go/
MIT License
1.64k stars 842 forks source link

Bug(docs): `armconnectedvmware` docs example reference a non existing client #22158

Open erezrokah opened 10 months ago

erezrokah commented 10 months ago

Bug Report

v1.0.0 of this package removed NewVirtualMachinesClient, see https://github.com/Azure/azure-sdk-for-go/blob/2621632e48ea508e16ce568001402f92fca4afa0/sdk/resourcemanager/connectedvmware/armconnectedvmware/CHANGELOG.md#100-2023-10-27

However it's still referenced from the docs https://github.com/Azure/azure-sdk-for-go/tree/2621632e48ea508e16ce568001402f92fca4afa0/sdk/resourcemanager/connectedvmware/armconnectedvmware#clients

Alancere commented 10 months ago

Hi @erezrokah thanks for this issue! . You can check the information of the new version on CHANGELOG. I have submitted PR to fix doc.

erezrokah commented 10 months ago

Thanks @erezrokah I can see it was removed, I'm just not sure what replaced it. It's still available in the REST API and the old version of the Go SDK that has it still works

Alancere commented 10 months ago

The sdk/resourcemanager/connectedvmware/armconnectedvmware/v1.0.0 generated is dependent on the swagger

github-actions[bot] commented 10 months ago

Hi @erezrokah. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

erezrokah commented 10 months ago

The sdk/resourcemanager/connectedvmware/armconnectedvmware/v1.0.0 generated is dependent on the swagger

Thank you for the response. Can we you advise how can someone use the Go SDK to retrieve the data from https://learn.microsoft.com/en-us/azure/templates/microsoft.connectedvmwarevsphere/2022-01-10-preview/virtualmachines?pivots=deployment-language-arm-template?

What should we use instead of NewVirtualMachinesClient?

Alancere commented 10 months ago

The sdk/resourcemanager/connectedvmware/armconnectedvmware/v1.0.0 generated is dependent on the swagger

Thank you for the response. Can we you advise how can someone use the Go SDK to retrieve the data from https://learn.microsoft.com/en-us/azure/templates/microsoft.connectedvmwarevsphere/2022-01-10-preview/virtualmachines?pivots=deployment-language-arm-template?

What should we use instead of NewVirtualMachinesClient?

Service Team Answer: the VIrtualMachine resource has been removed from the latest swagger due to resource modelling change. VirtualMachineInstance is the newly added resource type for this: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/connectedvmware/resource-manager/Microsoft.ConnectedVMwarevSphere/stable/2023-10-01/connectedvmware.json#L2623

You could try NewVirtualMachineInstancesClient

erezrokah commented 10 months ago

You could try NewVirtualMachineInstancesClient

I'm trying to use this one but looking at the example looks like I need to pass a VM resource ID: https://github.com/Azure/azure-sdk-for-go/blob/2621632e48ea508e16ce568001402f92fca4afa0/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachineinstances_client_example_test.go#L240

How can I list the VMs and get the IDs to list the instances?

Alancere commented 10 months ago

You could try NewVirtualMachineInstancesClient

I'm trying to use this one but looking at the example looks like I need to pass a VM resource ID:

https://github.com/Azure/azure-sdk-for-go/blob/2621632e48ea508e16ce568001402f92fca4afa0/sdk/resourcemanager/connectedvmware/armconnectedvmware/virtualmachineinstances_client_example_test.go#L240

How can I list the VMs and get the IDs to list the instances?

You could use "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.HybridCompute/machines/DemoVM" replace "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg" try

erezrokah commented 10 months ago

Passing scope := "subscriptions/****/resourceGroups/****/providers/Microsoft.HybridCompute/machines" I get

GET https://management.azure.com/subscriptions/****/resourceGroups/****/providers/Microsoft.HybridCompute/machines/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances

The Resource 'Microsoft.HybridCompute/machines/providers' under resource group '****' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

Passing scope := "subscriptions/****/resourceGroups/****" I get

GET https://management.azure.com/subscriptions/****/resourceGroups/****/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances

Resource type 'virtualmachineinstances' of provider namespace 'Microsoft.ConnectedVMwarevSphere' was not found in global location for api version '2023-10-01'

Which one should I use and are the errors expected?

github-actions[bot] commented 10 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @akashkeshari.

erezrokah commented 9 months ago

Hi 👋 When are we expected to receive an update on the issue?

Alancere commented 9 months ago

I found that virtualmachineinstances already exist on azure portal. Please try again. image

github-actions[bot] commented 9 months ago

Hi @erezrokah. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

erezrokah commented 9 months ago

I found that virtualmachineinstances already exist on azure portal. Please try again.

Hi @Alancere which scope from https://github.com/Azure/azure-sdk-for-go/issues/22158#issuecomment-1867492073 is expected to work?