Skip to content

Comments

fix the hardcoding of api version for classicadmin in powershell#2502

Merged
mcardosos merged 2 commits intoAzure:masterfrom
darshanhs90:master
Feb 21, 2018
Merged

fix the hardcoding of api version for classicadmin in powershell#2502
mcardosos merged 2 commits intoAzure:masterfrom
darshanhs90:master

Conversation

@darshanhs90
Copy link
Contributor

@darshanhs90 darshanhs90 commented Feb 15, 2018

This is a fix for this hardcoding
https://github.com/Azure/azure-powershell/blob/preview/src/ResourceManager/Resources/Commands.Resources/Models.Authorization/AuthorizationClient.cs#L297

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Feb 15, 2018

Automation for azure-sdk-for-python

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-python#1916

@AutorestCI
Copy link

AutorestCI commented Feb 15, 2018

Automation for azure-sdk-for-go

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-go#1115

@azuresdkciprbot
Copy link

Hi There,

I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result:

File: specification/authorization/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 0
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

1 similar comment
@azuresdkciprbot
Copy link

Hi There,

I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result:

File: specification/authorization/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 0
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@darshanhs90
Copy link
Contributor Author

@mcardosos can you take a look into this,had to make a minor fix since the api version was moved to parameters section,we werent able to hardcode the api version like before[which isnt recommeded also]

@mcardosos
Copy link
Contributor

@darshanhs90
To clarify (I am not familiar with Azure Powershell) How is it that moving files fixes the issue?
Is it because now files are in the wrong api version folder, and with this change they will be in the right api version folder, so it does not need to be overriden?

@darshanhs90
Copy link
Contributor Author

@mcardosos no earlier,since we had a apiversion as follows
"/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/classicAdministrators": {
"get": {
"tags": [
"ClassicAdministrators"
],
"operationId": "ClassicAdministrators_List",
"description": "Gets service administrator, account administrator, and co-administrators for the subscription.",
"parameters": [
{
"name": "api-version",
"in": "query",

"required": true,
"type": "string",
"description": "The API version to use for this operation."
}

which allowed us to modify the api version in sdk and powershell for all the classicadmin requests[since we had a single swagger file with 2015-07-01 version]
The reason for hardcoding it in the requests was that classicadmin api supported only 2015-06-01 and not the other API version[2015-07-01]

Hence i made this PR to fix that issue.
As we moved the api-version to Parameters section ,it doesn't allow us to pass in the api version as part of the request like earlier causing the classicadmin calls to hit the api version 2015-07-01 resulting in bad request

@mcardosos
Copy link
Contributor

Oh, okok :) Moving the files is the right thing to do in this case, yes.
If in the future, you happen to have a global param you want to pass in the method, take a look here
https://github.com/Azure/autorest/tree/master/docs/extensions#x-ms-parameter-location
(However, I wound not recommend this for API version parameter).

Change LGTM. @fearthecowboy is this change good for you too? For context, the operation ClassicAdministrators_List that is being removed in authorization.json, already exists in authorization-ClasicAdminCalls.json

@darshanhs90
Copy link
Contributor Author

@mcardosos anything blocking this pr to be merged?

@fearthecowboy
Copy link
Contributor

I don't see a problem. @lmazuel -- you have any problem with this?

@lmazuel
Copy link
Member

lmazuel commented Feb 21, 2018

LGTM thanks @fearthecowboy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants