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

Consumption specifications for cost insights and reporting operations #3171

Merged
merged 10 commits into from
Jun 14, 2018
Merged

Consumption specifications for cost insights and reporting operations #3171

merged 10 commits into from
Jun 14, 2018

Conversation

shalinved
Copy link
Contributor

@shalinved shalinved commented Jun 1, 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

@msftclas
Copy link

msftclas commented Jun 1, 2018

CLA assistant check
All CLA requirements met.

@AutorestCI
Copy link

AutorestCI commented Jun 1, 2018

Automation for azure-libraries-for-java

Nothing to generate for azure-libraries-for-java

@AutorestCI
Copy link

AutorestCI commented Jun 1, 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 Jun 1, 2018

Automation for azure-sdk-for-node

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-node#2700

@AutorestCI
Copy link

AutorestCI commented Jun 1, 2018

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link

AutorestCI commented Jun 1, 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#2076

@lmazuel lmazuel added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jun 1, 2018
@lmazuel
Copy link
Member

lmazuel commented Jun 1, 2018

Hi @shalinved
Since it's a new API, adding @ravbhatnagar for ARM feedback
Please also fix all CI issues. For instance:

ERROR: Referenced file 'file:///tmp/tmp6a6_3m9v/rest/specification/consumption/resource-manager/Microsoft.Consumption/stable/2018-05-31/e./examples/ReportConfigDelete.json' not found

Thanks!

@shalinved
Copy link
Contributor Author

@lmazuel - I just pushed a commit to fix bad reference for ReportConfigDelete.
@ravbhatnagar - Hi, Gaurav, these APIs are the ones we talked about some time back and had a casual discussion about. Let me know if you would like to schedule a formal review meeting.

@lmazuel
Copy link
Member

lmazuel commented Jun 4, 2018

@fearthecowboy Autorest fails saying this:

FATAL: System.InvalidOperationException: Method with x-ms-odata needs to have "$filter" parameter.

But all linter rules are fine and green. Is this a linter problem? Autorest problem?

@fearthecowboy
Copy link
Member

I would think there needs to be a linter rule for this; https://github.com/Azure/autorest.common/blob/e85fe8a6a6c89a62c93708f7da4a8c555590c436/src/AzureExtensions.cs shows that it expects the $filter ...

Copy link
Contributor

@ravbhatnagar ravbhatnagar left a comment

Choose a reason for hiding this comment

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

@shalinved - lets schedule a quick sync to go over these. I have a few questions about these. Also, please loop in folks from azureapirbcore - @johanste @devigned @fearthecowboy

}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/reportconfigs/{reportConfigName}": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is reportConfigs created under a resource group or under a subscription?

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldnt it be created under an RG

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We allow report configurations to be created under a subscription as well as under a RG. This determines scope of the data in the report. This is similar to what we do currently in Consumption Budgets as well.

"type": "string",
"description": "Resource type."
},
"tags": {
Copy link
Contributor

Choose a reason for hiding this comment

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

why this is readonly?

@ravbhatnagar
Copy link
Contributor

Had a call with Shalin - 3 things -

  1. POST APIs for insights - change the name to represent an action - ex- generateInsight. We discussed about making these PUT and enabling GET. Currently someone needs this action permission to call this API. Reader cant get the insight. RP is fine with this behavior
  2. Reference to storage account should be through resourceID with Linked access check enabled. - blocking feedback
  3. Make sure the size of data coming back in response for dimensions is under the ARM limits. As it can grow, it can cause problems.

@ms-premp
Copy link
Contributor

ms-premp commented Jun 7, 2018

adding @ms-premp

@ravbhatnagar
Copy link
Contributor

@shalinved - any updates on this? @ms-premp ?

@shalinved
Copy link
Contributor Author

@ravbhatnagar - Resource id changes are done. I am waiting for a decision on the name of Insights API.

@shalinved
Copy link
Contributor Author

The names we came up with for the API are - QueryUsage and/or AnalyzeUsage. Do you have any preference?

@shalinved
Copy link
Contributor Author

@marbing - Adding Matt to the discussion

@shalinved
Copy link
Contributor Author

@ravbhatnagar - I have pushed changes that would take care of points 1 and 2 above.
I have modified our request contract to accept an ARM resource id for the storage account where reports will be delivered. We will use ARM linked access check to validate user has read permissions on the resource while creating a report configuration.
I have also updated the Insights API to AnalyzeUsage.
We do have checks in place to make sure we don't go above ARM limits for Dimensions API. The API is pageable with a page size of 1000 records.
Could you please review the changes.

@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 Jun 14, 2018
@ravbhatnagar
Copy link
Contributor

looks good

"format": "date-time",
"type": "string"
},
"nextLink": {
Copy link
Member

@lmazuel lmazuel Jun 14, 2018

Choose a reason for hiding this comment

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

Why would this object get a nextLink? Just checking that it's accurate, since it's not usual and SDK won't be able to do anything with that, and polling would be manual.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @imazuel
This is intentional. The response here is a single object and not a list of object. The single object however, can have a very big payload in data field. Hence, the need for pagination. We are aware that SDKs will not be able to parse it automatically and we will have additional work to support this in SDK.
This pattern is already used in one other API v.i.z. Pricesheets. We had multiple back and forth discussions with ARM team and this is the only way we can come up with since the response here is a single ARM resource object and not an array of ARM resources.

Copy link
Member

@lmazuel lmazuel left a comment

Choose a reason for hiding this comment

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

One question to confirm something unusual, otherwise LGTM

@lmazuel lmazuel merged commit 30f1846 into Azure:master Jun 14, 2018
@jhendrixMSFT
Copy link
Member

@AutorestCI regenerate azure-sdk-for-go

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.

8 participants