Skip to content

Conversation

@LucasYao93
Copy link
Contributor

Description

Add test cases and examples of CostManagement.

@adxsdkps
Copy link
Collaborator

adxsdkps commented Jul 5, 2020

Can one of the admins verify this patch?

Comment on lines 70 to 79
### Example 4: Get a cost management export by pipeline
```powershell
PS C:\> @{Id = 'subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/providers/Microsoft.CostManagement/exports/TestExport' } | Get-AzCostManagementExport

Name Type
---- ----
TestExport Microsoft.CostManagement/exports
```

This command gets a cost management export by pipeline.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I think this example is not necessary for this cmdlet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 42 to 48
### Example 2: Get execution history of cost management export by object
```powershell
PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t"
PS C:\> Get-AzCostManagementExportExecutionHistory -InputObject $export

Name Type
---- ----
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's better that change this example as by Piping:

PS C:\> Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t" | Get-AzCostManagementExportExecutionHistory

or

PS C:\> $export = Get-AzCostManagementExport -Scope "subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f" -ExportName "ps-customcolum-t"
PS C:\> $export | Get-AzCostManagementExportExecutionHistory

And please update this exmaple result after pulling the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


### -Scope
The scope associated with query and export operations.
This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId} for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not accurate. Scope is not start with /. We need to change the description of all Scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be generated automatically. I shouldn't be able to change. isn't it ?

@LucasYao93 LucasYao93 requested a review from wyunchi-ms July 6, 2020 09:53
@wyunchi-ms wyunchi-ms merged commit 88cfab0 into Azure:wyunchi/CostManagement Jul 7, 2020
@LucasYao93 LucasYao93 deleted the lucas/CostManagement branch September 3, 2020 06:58
wyunchi-ms added a commit that referenced this pull request Dec 2, 2020
* Init for CostManagement

* save

* Fix the issues of url

* Fix format table of QueryRusult

* Fix the issue of new resource

* Fix the issue of format table of Get-AzCostmanagementExportExecuteHistory

* Add test cases and examples of CostManagement. (#12325)

* Add test cases and example of CostManagement.

* Modified test cases and example of CostManagement.

* Fix the issue of format table of Get-AzCostmanagementExportExecuteHistory

* update readme

* Update api-version

* Update api-version

* Add generate code and tests for costmanagement

* update some json files

* Improve code quality

* Add Examples for cmdlets

* Update the commit id

* Update Invoke-AzCostManagementQuery.ps1

Co-authored-by: wyunchi-ms <[email protected]>
Co-authored-by: wyunchi-ms <[email protected]>
Co-authored-by: LucasYao93 <[email protected]>
Co-authored-by: Yunchi Wang <[email protected]>
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.

3 participants