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

Added schema spec for cost allocation tags #2742

Merged
merged 23 commits into from
Apr 6, 2018
Merged

Added schema spec for cost allocation tags #2742

merged 23 commits into from
Apr 6, 2018

Conversation

asarkar84
Copy link
Contributor

@asarkar84 asarkar84 commented Mar 23, 2018

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 Mar 23, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2158

@AutorestCI
Copy link

AutorestCI commented Mar 23, 2018

Automation for azure-libraries-for-java

Nothing to generate for azure-libraries-for-java

@AutorestCI
Copy link

AutorestCI commented Mar 23, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#2700

@AutorestCI
Copy link

AutorestCI commented Mar 23, 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#1526

"in": "path",
"description": "Azure Billing Account ID.",
"required": true,
"type": "string"
Copy link
Contributor

Choose a reason for hiding this comment

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

This causes a breaking change in the sdk. Refer to this comment.
This parameter should have "x-ms-parameter-location": "method" extension applied.

Whoever merged the PR last time did not catch that grainParameter defined below also has missing"x-ms-parameter-location": "method" extension

Copy link
Contributor

Choose a reason for hiding this comment

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

This should have been caught when this PR was sent 9 days ago.

Copy link
Contributor

Choose a reason for hiding this comment

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

@marstr - Please take a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added "x-ms-parameter-location": "method" for grainParameter.
billing accounts parameter requires some other changes from our end. Will update that shortly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. But please make sure to add "x-ms-parameter-location": "method" for "billingAccountIdParameter" as well.

Updated Get Operation
Incorporated review comments
@sergey-shandar
Copy link
Contributor

@amarzavery Could you confirm that the issue is fixed?

@sergey-shandar
Copy link
Contributor

@ravbhatnagar new operations.

@sergey-shandar sergey-shandar added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Mar 23, 2018
@amarzavery
Copy link
Contributor

@sergey-shandar - The issue has been fixed for grainParameter but not for "billingAccountIdParameter". That should also have "x-ms-parameter-location": "method". Please make sure to not merge the PR until that happens.

@sergey-shandar
Copy link
Contributor

@amarzavery thank you. @asarkar84 could you fix billingAccountIdParameter as well?

Review comments incorporated
@asarkar84
Copy link
Contributor Author

billingAccountIdParameter is fixed as well.

Updated path
"id": "providers/Microsoft.CostManagement/billingAccounts/{billingaccount-id}/providers/Microsoft.Consumption/costAllocationTags/costAllocationTags1",
"name": "costAllocationTags1",
"type": "Microsoft.Consumption/costAllocationTags",
"eTag": "\"1d34d012214157f\"",
Copy link
Contributor

Choose a reason for hiding this comment

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

@asarkar84 - As per the definition of "eTag" in the spec, it is a string.

What is the reason behind escaping the quotes "\"1d34d012214157f\""? Wouldn't this "1d34d012214157f" be sufficient? Why is the service sending a string with quotes in it ?
/cc @sergey-shandar - FYI.

Copy link
Contributor Author

@asarkar84 asarkar84 Mar 27, 2018

Choose a reason for hiding this comment

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

This is how azure services or apis do eTag: " For example, I checked the CosmosDB data explorer which is publicly available. I found _eTag property exposed there and the service returns it with quotes. Storage also has quotes in their eTag. Since 2 double quotes are not accepted in json we need to escape one which is inside the value.

PFB the CosmosDB example for reference:
_etag": ""00000e3a-0000-0000-0000-59c94cd20000"",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@amarzavery Just refer any public API for reference, eTag will have quote. Escape char is used as per json standard since it will not accept 2 quotes like this ""

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the explanation. That makes sense.

@asarkar84
Copy link
Contributor Author

@amarzavery @sergey-shandar Just wanted to know for my own understanding, what is the use of this: "x-ms-parameter-location": "method"

why this is not required for apiVersionParameter and subscriptionIdParameter? It will be good for me to know this in future.

@amarzavery
Copy link
Contributor

@asarkar8 - You can find detailed explanation about the extension "x-ms-parameter-location": "method" over here.

@asarkar84
Copy link
Contributor Author

I appreciate! This is helpful.

@asarkar84
Copy link
Contributor Author

The path has been finalized at our end. Please resume the review and merge the PR if it looks good.

@ravbhatnagar
Copy link
Contributor

Signing off from ARM side.

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 5, 2018
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants