Skip to content

Storage sku list operation and fix a comment to VirtualNetworkResourceId#1579

Merged
veronicagg merged 4 commits intoAzure:currentfrom
JasonYang-MSFT:storageskus
Aug 31, 2017
Merged

Storage sku list operation and fix a comment to VirtualNetworkResourceId#1579
veronicagg merged 4 commits intoAzure:currentfrom
JasonYang-MSFT:storageskus

Conversation

@JasonYang-MSFT
Copy link
Copy Markdown
Member

@JasonYang-MSFT JasonYang-MSFT commented Aug 23, 2017

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

@JasonYang-MSFT
Copy link
Copy Markdown
Member Author

JasonYang-MSFT commented Aug 23, 2017

Also resolve issue #651

@azuresdkciprbot
Copy link
Copy Markdown

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/storage/resource-manager/readme.md
Before the PR: Warning(s): 11 Error(s): 0
After the PR: Warning(s): 12 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues

Send feedback and make AutoRest Linter Azure Bot smarter day by day!

Thanks for your co-operation.

@veronicagg veronicagg added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Aug 24, 2017
Copy link
Copy Markdown
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JasonYang-MSFT for submitting this PR.
Have these changes been deployed to ARM already?
Since you're adding an operation and some properties, I'm adding @ravbhatnagar from ARM team to take a look and sign-off. Thanks!

"type": "string",
"description": "The name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc."
},
"value": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be an enum?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean "value" or "SKUCapability"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonYang-MSFT Maybe I'm off base, but if the "value" an only be "true" or "false", shouldn't be this defined as a boolean directly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmazuel Agreed, too. Boolean is the first thing I tried, but in fact, http response returned a 'string' with value 'true' or 'false' instead of true or false: https://github.com/JasonYang-MSFT/azure-rest-api-specs/blob/storageskus/specification/storage/resource-manager/Microsoft.Storage/2017-06-01/examples/SKUList.json#L69.
It also failed validation with oav validate-example .\storage.json, message: 'Expected type boolean but found type string'. Though generated .Net code could parse it as boolean, but not sure about other languages.

This api exists for a long time, even in 2015-05-01-preview, and it is only in response, so I choose to make it as a string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Note that for Python it would have work ok even with the string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vishrutshah @amarzavery should ova be improved to accept "string" as potentially valid "bool" input? Or is it really a problem? Seems C# and Python support it at least, and would be a better customer experience.

Copy link
Copy Markdown
Contributor

@vishrutshah vishrutshah Aug 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmazuel Isn't the 'true' a json string type and true as json boolean type? I think if service says it's boolean what are the possible reasons for the service to send string 'true'? Doesn't that make swagger contract wrong? I see that point for better SDK experience but not sure we should open gates where swagger contract gets violated? Thoughts?

},
"description": "The capability information in the specified sku, including file encryption, network acls, change notification, etc."
},
"restrictions": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considered a breaking change - @ravbhatnagar please review

Copy link
Copy Markdown
Member Author

@JasonYang-MSFT JasonYang-MSFT Aug 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veronicagg Do you mean adding parameters to an object? If so, I can create an 'sku' type specially for list operation. Current 'sku' is used in create/update storage account, extra parameters are not used in create/update. Adding extra parameters instead of creating a new object is trying to reuse the type name of 'SKU'.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veronicagg Just FYI, in Python we consider this non breaking (adding an optional parameter at the end). Please take this opportunity to tell in which language it's breaking (I need to improve my Swagger reviewing skill ;))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JasonYang-MSFT - ChecknameAvailability API as defined in the ARM RPC should be used to indicate whether a given resource name is available or not. It seems like in this case you are returning more information that what is required in the contract. Why is it needed to return all this extra information like kind, resource type, locations etc. resource type goes in the request body. Locations go in the URL to verify local uniqueness. Not sure why you need kind or SKUCapability to be returned for this API.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ravbhatnagar Sorry, am I miss something here?
This PR is about sku list operation, "ChecknameAvailability" is not updated in this PR and it is already in the swagger.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops.. @JasonYang-MSFT - please ignore my earlier comment. The way the changes were diff'd in Github gave the impression that all these properties are added to the response of checkNameAvailability :).
The only feedback here is that restrictions should have type, values and reasonCode properties and all these are require for restrictions. restriction.type is most likely locations today. And so the restriction.values will contain the list of locations where the skus is restricted. and then there will be a reason for the restriction in reasoncode. Does that make sense? and yes, this is not a breaking change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, your comment is addressed. Please kindly take a look.

@JasonYang-MSFT
Copy link
Copy Markdown
Member Author

Hi @veronicagg, what do I need to do to drive this PR forward? It seems we stuck on the discussion. Will @ravbhatnagar evaluate this breaking?

@veronicagg
Copy link
Copy Markdown
Contributor

@JasonYang-MSFT not stuck, we're pending @ravbhatnagar sign-off from ARM side, once that's in, i'm good approving this PR.
Based on what you state below, it appears all these changes are deployed already, right?

@JasonYang-MSFT
Copy link
Copy Markdown
Member Author

JasonYang-MSFT commented Aug 28, 2017

@veronicagg Yes, they all deployed already.
Did @ravbhatnagar notice this PR is pending on his sign-off? Do we have a rough ETA?

@veronicagg
Copy link
Copy Markdown
Contributor

@JasonYang-MSFT yes, he should know, plus I sent him offline email (with you cc'd) as well. We have a ton of PRs coming in right now, we're doing our best to keep up.

@ravbhatnagar ravbhatnagar added ReadyForSDKReview and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Aug 29, 2017
@veronicagg
Copy link
Copy Markdown
Contributor

@JasonYang-MSFT Please address pending comment from @ravbhatnagar above (#1579 (comment)).
@ravbhatnagar SDK review was done from my side, so when you are ready, please sign-off from ARM side.

@azuresdkciprbot
Copy link
Copy Markdown

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/storage/resource-manager/readme.md
Before the PR: Warning(s): 11 Error(s): 0
After the PR: Warning(s): 12 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues

Send feedback and make AutoRest Linter Azure Bot smarter day by day!

Thanks for your co-operation.

@ravbhatnagar ravbhatnagar added the ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review label Aug 30, 2017
@ravbhatnagar
Copy link
Copy Markdown
Contributor

Looks good. @veronicagg @JasonYang-MSFT ARM signed off.

@veronicagg veronicagg merged commit 971c9dd into Azure:current Aug 31, 2017
@AutorestCI
Copy link
Copy Markdown

No modification for AutorestCI/azure-sdk-for-node

@AutorestCI
Copy link
Copy Markdown

@AutorestCI
Copy link
Copy Markdown

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

Labels

ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review ReadyForSDKReview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants