Skip to content

Commit

Permalink
Merge pull request Azure#38 from wecha-ms/dev
Browse files Browse the repository at this point in the history
Azs.Commerce.Admin: add example, remove docs, check quantity to pester
  • Loading branch information
bganapa authored Feb 14, 2020
2 parents 9d280f8 + 217fb03 commit 6e8a836
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 201 deletions.
16 changes: 0 additions & 16 deletions src/Azs.Commerce.Admin/docs/Azs.Commerce.Admin.md

This file was deleted.

172 changes: 0 additions & 172 deletions src/Azs.Commerce.Admin/docs/Get-AzsSubscriberUsage.md

This file was deleted.

11 changes: 0 additions & 11 deletions src/Azs.Commerce.Admin/docs/readme.md

This file was deleted.

14 changes: 14 additions & 0 deletions src/Azs.Commerce.Admin/examples/Get-AzsSubscriberUsage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Example 1: Get usage data aggregated by day
```powershell
Get-AzsSubscriberUsage -ReportedStartTime "2019-12-30T00:00:00Z" -ReportedEndTime "2019-12-31T00:00:00Z" -AggregationGranularity Daily
```

Get the usage data for the entire day of 30th Dec 2019 (in UTC) for all tenants under provider aggregated by the day. ReportedStartTime and ReportedEndTime must be rounded to days. If called as the service administrator, this effectively shows all usage data for every tenant.

### Example 2: Get usage data aggregated by the hour
```powershell
Get-AzsSubscriberUsage -ReportedStartTime "2019-12-30T00:00:00Z" -ReportedEndTime "2019-12-30T02:00:00Z" -AggregationGranularity Hourly
```

Get the usage data between 12am - 2am on 30th Dec 2019 (in UTC) aggregated by the hour. ReportedStartTime and ReportedEndTime must be rounded to hours. Likewise, if called as the service administrator, this effectively shows all usage data for every tenant.

3 changes: 1 addition & 2 deletions src/Azs.Commerce.Admin/test/Common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ function ValidateAzsSubscriberUsage {
{
$record.UsageStartTime | Should Not Be $null
$record.UsageEndTime | Should Not Be $null
## TODO: Current quantity is not picked up
## Pester v3 does not support BeGreaterOrEqual
#$record.Quantity -ge 0 | Should Be $true
$record.Quantity -ge 0 | Should Be $true
$record.MeterId | Should Not Be $null
$record.SubscriptionId | Should Not Be $null

Expand Down

0 comments on commit 6e8a836

Please sign in to comment.