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

Add billing period model #339

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Commands/billing/period/_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# [Command] _billing period list_

List the available billing periods for a subscription in reverse chronological order.

This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API.

## Versions

### [2018-03-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5iaWxsaW5nL2JpbGxpbmdwZXJpb2Rz/2018-03-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/providers/microsoft.billing/billingperiods 2018-03-01-preview -->
11 changes: 11 additions & 0 deletions Commands/billing/period/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# [Command] _billing period show_

Show a named billing period.

This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API.

## Versions

### [2018-03-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5iaWxsaW5nL2JpbGxpbmdwZXJpb2RzL3t9/2018-03-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/providers/microsoft.billing/billingperiods/{} 2018-03-01-preview -->
11 changes: 11 additions & 0 deletions Commands/billing/period/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# [Group] _billing period_

Manage billing periods for a subscription.

## Commands

- [list](/Commands/billing/period/_list.md)
: List the available billing periods for a subscription in reverse chronological order.

- [show](/Commands/billing/period/_show.md)
: Show a named billing period.
8 changes: 8 additions & 0 deletions Commands/billing/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [Group] _billing_

Manage Azure Billing.

## Subgroups

- [period](/Commands/billing/period/readme.md)
: Manage billing periods for a subscription.
3 changes: 3 additions & 0 deletions Commands/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
- [automation](/Commands/automation/readme.md)
: Manage Automation Account

- [billing](/Commands/billing/readme.md)
: Manage Azure Billing.

- [billing-benefits](/Commands/billing-benefits/readme.md)
: Azure billing benefits commands

Expand Down
71 changes: 71 additions & 0 deletions Commands/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,77 @@
"automation"
]
},
"billing": {
"commandGroups": {
"period": {
"commands": {
"list": {
"help": {
"lines": [
"This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API."
],
"short": "List the available billing periods for a subscription in reverse chronological order."
},
"names": [
"billing",
"period",
"list"
],
"versions": [
{
"name": "2018-03-01-preview",
"resources": [
{
"id": "/subscriptions/{}/providers/microsoft.billing/billingperiods",
"plane": "mgmt-plane",
"version": "2018-03-01-preview"
}
]
}
]
},
"show": {
"help": {
"lines": [
"This is only supported for Azure Web-Direct subscriptions. Other subscription types which were not purchased directly through the Azure web portal are not supported through this preview API."
],
"short": "Show a named billing period."
},
"names": [
"billing",
"period",
"show"
],
"versions": [
{
"name": "2018-03-01-preview",
"resources": [
{
"id": "/subscriptions/{}/providers/microsoft.billing/billingperiods/{}",
"plane": "mgmt-plane",
"version": "2018-03-01-preview"
}
]
}
]
}
},
"help": {
"short": "Manage billing periods for a subscription."
},
"names": [
"billing",
"period"
]
}
},
"help": {
"short": "Manage Azure Billing."
},
"names": [
"billing"
]
},
"billing-benefits": {
"commandGroups": {
"reservation-order-aliases": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/providers/microsoft.billing/billingperiods", "version": "2018-03-01-preview", "swagger": "mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHM=/V/MjAxOC0wMy0wMS1wcmV2aWV3"}], "commandGroups": [{"name": "billing period", "commands": [{"name": "list", "version": "2018-03-01-preview", "resources": [{"id": "/subscriptions/{}/providers/microsoft.billing/billingperiods", "version": "2018-03-01-preview", "swagger": "mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHM=/V/MjAxOC0wMy0wMS1wcmV2aWV3"}], "argGroups": [{"name": "", "args": [{"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}, {"type": "string", "var": "$Query.filter", "options": ["filter"], "help": {"short": "May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'."}}, {"type": "string", "var": "$Query.skiptoken", "options": ["skiptoken"], "help": {"short": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls."}}, {"type": "integer32", "var": "$Query.top", "options": ["top"], "help": {"short": "May be used to limit the number of results to the most recent N billing periods."}, "format": {"maximum": 100, "minimum": 1}}]}], "operations": [{"operationId": "BillingPeriods_List", "http": {"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods", "request": {"method": "get", "path": {"params": [{"type": "string", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true}]}, "query": {"params": [{"type": "string", "name": "$filter", "arg": "$Query.filter"}, {"type": "string", "name": "$skiptoken", "arg": "$Query.skiptoken"}, {"type": "integer32", "name": "$top", "arg": "$Query.top", "format": {"maximum": 100, "minimum": 1}}], "consts": [{"readOnly": true, "const": true, "default": {"value": "2018-03-01-preview"}, "type": "string", "name": "api-version", "required": true}]}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"readOnly": true, "type": "string", "name": "nextLink"}, {"readOnly": true, "type": "array<object>", "name": "value", "item": {"type": "object", "props": [{"readOnly": true, "type": "ResourceId", "name": "id", "format": {"template": "/subscriptions/{}/providers/Microsoft.Billing/billingPeriods/{}"}}, {"readOnly": true, "type": "string", "name": "name"}, {"type": "object", "name": "properties", "props": [{"readOnly": true, "type": "date", "name": "billingPeriodEndDate"}, {"readOnly": true, "type": "date", "name": "billingPeriodStartDate"}, {"readOnly": true, "type": "array<string>", "name": "invoiceIds", "item": {"type": "string"}}], "clientFlatten": true}, {"readOnly": true, "type": "string", "name": "type"}]}}]}}}}, {"isError": true, "body": {"json": {"schema": {"type": "@ODataV4Format"}}}}]}}], "outputs": [{"type": "array", "ref": "$Instance.value", "clientFlatten": true, "nextLink": "$Instance.nextLink"}], "confirmation": ""}]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version='1.0' encoding='utf-8'?>
<CodeGen plane="mgmt-plane">
<resource id="/subscriptions/{}/providers/microsoft.billing/billingperiods" version="2018-03-01-preview" swagger="mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHM=/V/MjAxOC0wMy0wMS1wcmV2aWV3"/>
<commandGroup name="billing period">
<command name="list" version="2018-03-01-preview" confirmation="">
<resource id="/subscriptions/{}/providers/microsoft.billing/billingperiods" version="2018-03-01-preview" swagger="mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHM=/V/MjAxOC0wMy0wMS1wcmV2aWV3"/>
<argGroup name="">
<arg type="SubscriptionId" var="$Path.subscriptionId" options="subscription" required="True" idPart="subscription"/>
<arg type="string" var="$Query.filter" options="filter">
<help short="May be used to filter billing periods by billingPeriodEndDate. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'."/>
</arg>
<arg type="string" var="$Query.skiptoken" options="skiptoken">
<help short="Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls."/>
</arg>
<arg type="integer32" var="$Query.top" options="top">
<help short="May be used to limit the number of results to the most recent N billing periods."/>
<format maximum="100" minimum="1"/>
</arg>
</argGroup>
<operation operationId="BillingPeriods_List">
<http path="/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods">
<request method="get">
<path>
<param type="string" name="subscriptionId" arg="$Path.subscriptionId" required="True"/>
</path>
<query>
<param type="string" name="$filter" arg="$Query.filter"/>
<param type="string" name="$skiptoken" arg="$Query.skiptoken"/>
<param type="integer32" name="$top" arg="$Query.top">
<format maximum="100" minimum="1"/>
</param>
<const readOnly="True" const="True" type="string" name="api-version" required="True">
<default value="&quot;2018-03-01-preview&quot;"/>
</const>
</query>
</request>
<response statusCode="200">
<body>
<json var="$Instance">
<schema type="object">
<prop readOnly="True" type="string" name="nextLink"/>
<prop readOnly="True" type="array<object>" name="value">
<item type="object">
<prop readOnly="True" type="ResourceId" name="id">
<format template="/subscriptions/{}/providers/Microsoft.Billing/billingPeriods/{}"/>
</prop>
<prop readOnly="True" type="string" name="name"/>
<prop type="object" name="properties" clientFlatten="True">
<prop readOnly="True" type="date" name="billingPeriodEndDate"/>
<prop readOnly="True" type="date" name="billingPeriodStartDate"/>
<prop readOnly="True" type="array<string>" name="invoiceIds">
<item type="string"/>
</prop>
</prop>
<prop readOnly="True" type="string" name="type"/>
</item>
</prop>
</schema>
</json>
</body>
</response>
<response isError="True">
<body>
<json>
<schema type="@ODataV4Format"/>
</json>
</body>
</response>
</http>
</operation>
<output type="array" ref="$Instance.value" clientFlatten="True" nextLink="$Instance.nextLink"/>
</command>
</commandGroup>
</CodeGen>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/providers/microsoft.billing/billingperiods/{}", "version": "2018-03-01-preview", "swagger": "mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHMve2JpbGxpbmdQZXJpb2ROYW1lfQ==/V/MjAxOC0wMy0wMS1wcmV2aWV3"}], "commandGroups": [{"name": "billing period", "commands": [{"name": "show", "version": "2018-03-01-preview", "resources": [{"id": "/subscriptions/{}/providers/microsoft.billing/billingperiods/{}", "version": "2018-03-01-preview", "swagger": "mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHMve2JpbGxpbmdQZXJpb2ROYW1lfQ==/V/MjAxOC0wMy0wMS1wcmV2aWV3"}], "argGroups": [{"name": "", "args": [{"type": "string", "var": "$Path.billingPeriodName", "options": ["n", "name"], "required": true, "group": "", "idPart": "name", "help": {"short": "Name of the billing period. Run the az billing period list command to list the name of billing period"}}, {"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}]}], "operations": [{"operationId": "BillingPeriods_Get", "http": {"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}", "request": {"method": "get", "path": {"params": [{"type": "string", "name": "billingPeriodName", "arg": "$Path.billingPeriodName", "required": true}, {"type": "string", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2018-03-01-preview"}, "type": "string", "name": "api-version", "required": true}]}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"readOnly": true, "type": "ResourceId", "name": "id", "format": {"template": "/subscriptions/{}/providers/Microsoft.Billing/billingPeriods/{}"}}, {"readOnly": true, "type": "string", "name": "name"}, {"type": "object", "name": "properties", "props": [{"readOnly": true, "type": "date", "name": "billingPeriodEndDate"}, {"readOnly": true, "type": "date", "name": "billingPeriodStartDate"}, {"readOnly": true, "type": "array<string>", "name": "invoiceIds", "item": {"type": "string"}}], "clientFlatten": true}, {"readOnly": true, "type": "string", "name": "type"}]}}}}, {"isError": true, "body": {"json": {"schema": {"type": "@ODataV4Format"}}}}]}}], "outputs": [{"type": "object", "ref": "$Instance", "clientFlatten": true}], "confirmation": ""}]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version='1.0' encoding='utf-8'?>
<CodeGen plane="mgmt-plane">
<resource id="/subscriptions/{}/providers/microsoft.billing/billingperiods/{}" version="2018-03-01-preview" swagger="mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHMve2JpbGxpbmdQZXJpb2ROYW1lfQ==/V/MjAxOC0wMy0wMS1wcmV2aWV3"/>
<commandGroup name="billing period">
<command name="show" version="2018-03-01-preview" confirmation="">
<resource id="/subscriptions/{}/providers/microsoft.billing/billingperiods/{}" version="2018-03-01-preview" swagger="mgmt-plane/billing/ResourceProviders/Microsoft.Billing/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkJpbGxpbmcvYmlsbGluZ1BlcmlvZHMve2JpbGxpbmdQZXJpb2ROYW1lfQ==/V/MjAxOC0wMy0wMS1wcmV2aWV3"/>
<argGroup name="">
<arg type="string" var="$Path.billingPeriodName" options="name n" required="True" group="" idPart="name">
<help short="Name of the billing period. Run the az billing period list command to list the name of billing period"/>
</arg>
<arg type="SubscriptionId" var="$Path.subscriptionId" options="subscription" required="True" idPart="subscription"/>
</argGroup>
<operation operationId="BillingPeriods_Get">
<http path="/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}">
<request method="get">
<path>
<param type="string" name="billingPeriodName" arg="$Path.billingPeriodName" required="True"/>
<param type="string" name="subscriptionId" arg="$Path.subscriptionId" required="True"/>
</path>
<query>
<const readOnly="True" const="True" type="string" name="api-version" required="True">
<default value="&quot;2018-03-01-preview&quot;"/>
</const>
</query>
</request>
<response statusCode="200">
<body>
<json var="$Instance">
<schema type="object">
<prop readOnly="True" type="ResourceId" name="id">
<format template="/subscriptions/{}/providers/Microsoft.Billing/billingPeriods/{}"/>
</prop>
<prop readOnly="True" type="string" name="name"/>
<prop type="object" name="properties" clientFlatten="True">
<prop readOnly="True" type="date" name="billingPeriodEndDate"/>
<prop readOnly="True" type="date" name="billingPeriodStartDate"/>
<prop readOnly="True" type="array<string>" name="invoiceIds">
<item type="string"/>
</prop>
</prop>
<prop readOnly="True" type="string" name="type"/>
</schema>
</json>
</body>
</response>
<response isError="True">
<body>
<json>
<schema type="@ODataV4Format"/>
</json>
</body>
</response>
</http>
</operation>
<output type="object" ref="$Instance" clientFlatten="True"/>
</command>
</commandGroup>
</CodeGen>