Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[armchangeanalysis] API version not available #24065

Open
vijayrajah opened this issue Feb 6, 2025 · 2 comments
Open

[armchangeanalysis] API version not available #24065

vijayrajah opened this issue Feb 6, 2025 · 2 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@vijayrajah
Copy link

vijayrajah commented Feb 6, 2025

Bug Report

I'm trying to get a list of resource changes.

I'm using github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/changeanalysis/armchangeanalysis module

in this module, the OperationsClient uses 2021-04-01 api version, as we can see here

But service returns following message

GET https://management.azure.com/providers/Microsoft.ChangeAnalysis/operations
	--------------------------------------------------------------------------------
	RESPONSE 404: 404 Not Found
	ERROR CODE: InvalidResourceType
	--------------------------------------------------------------------------------
	{
	  "error": {
	    "code": "InvalidResourceType",
	    "message": "The resource type 'operations' could not be found in the namespace 'Microsoft.ChangeAnalysis' for api version '2021-04-01'. The supported api-versions are '2019-04-01-preview,2020-04-01-preview'."
	  }
	}
	--------------------------------------------------------------------------------
	

This is the code I'm using (I'm testing so, I have a lot of panics() 's )

changeClientFactory, err := change.NewClientFactory(subsID, tCred, nil)
if err != nil {
	panic(err)
}


operClient := changeClientFactory.NewOperationsClient()

opPager := operClient.NewListPager(nil)
resop := make([]change.ResourceProviderOperationDefinition, 0)

for opPager.More() {
	page, err := opPager.NextPage(ctx)
	if err != nil {
		panic(err)
	}

	for _, c := range page.Value {
		if c != nil {
			resop = append(resop, *c)
		}
	}
}


v, err = json.Marshal(resop)
if err != nil {
	panic(err)
}

fmt.Printf("resop: %s\n", string(v))
@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 6, 2025
@jhendrixMSFT jhendrixMSFT added the Mgmt This issue is related to a management-plane library. label Feb 6, 2025
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 6, 2025
@lirenhe
Copy link
Member

lirenhe commented Feb 7, 2025

@jliusan, please help to repro this issue.

@vijayrajah, I don't think ChangeAnalysis has api verion of 2024-04-01,
this link https://learn.microsoft.com/en-us/rest/api/azureresourcegraph/resourcegraph/operations/list?view=rest-azureresourcegraph-resourcegraph-2024-04-01&tabs=HTTP is about azureresourcegraph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants