Skip to content

Commit

Permalink
Merge pull request #587 from Jing-song/jins-ext-subscription
Browse files Browse the repository at this point in the history
Migrate subscription to AAZ
  • Loading branch information
kairu-ms authored Oct 16, 2024
2 parents b0e06ef + 240cf66 commit 64a022b
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Commands/account/_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _account create_

Create a subscription.

## Versions

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

<!-- mgmt-plane /providers/microsoft.billing/enrollmentaccounts/{}/providers/microsoft.subscription/createsubscription 2018-03-01-preview -->
3 changes: 3 additions & 0 deletions Commands/account/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ Manage Azure subscription information.

## Commands

- [create](/Commands/account/_create.md)
: Create a subscription.

- [list-locations](/Commands/account/_list-locations.md)
: List supported regions for the current subscription.
22 changes: 22 additions & 0 deletions Commands/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,28 @@
},
"account": {
"commands": {
"create": {
"help": {
"short": "Create a subscription."
},
"names": [
"account",
"create"
],
"versions": [
{
"name": "2018-03-01-preview",
"resources": [
{
"id": "/providers/microsoft.billing/enrollmentaccounts/{}/providers/microsoft.subscription/createsubscription",
"plane": "mgmt-plane",
"version": "2018-03-01-preview"
}
],
"stage": "Preview"
}
]
},
"list-locations": {
"help": {
"short": "List supported regions for the current subscription."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plane": "mgmt-plane", "resources": [{"id": "/providers/microsoft.billing/enrollmentaccounts/{}/providers/microsoft.subscription/createsubscription", "version": "2018-03-01-preview", "swagger": "mgmt-plane/subscription/ResourceProviders/Microsoft.Subscription/Paths/L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmlsbGluZy9lbnJvbGxtZW50QWNjb3VudHMve2Vucm9sbG1lbnRBY2NvdW50TmFtZX0vcHJvdmlkZXJzL01pY3Jvc29mdC5TdWJzY3JpcHRpb24vY3JlYXRlU3Vic2NyaXB0aW9u/V/MjAxOC0wMy0wMS1wcmV2aWV3"}], "commandGroups": [{"name": "account", "commands": [{"name": "create", "version": "2018-03-01-preview", "resources": [{"id": "/providers/microsoft.billing/enrollmentaccounts/{}/providers/microsoft.subscription/createsubscription", "version": "2018-03-01-preview", "swagger": "mgmt-plane/subscription/ResourceProviders/Microsoft.Subscription/Paths/L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmlsbGluZy9lbnJvbGxtZW50QWNjb3VudHMve2Vucm9sbG1lbnRBY2NvdW50TmFtZX0vcHJvdmlkZXJzL01pY3Jvc29mdC5TdWJzY3JpcHRpb24vY3JlYXRlU3Vic2NyaXB0aW9u/V/MjAxOC0wMy0wMS1wcmV2aWV3"}], "argGroups": [{"name": "", "args": [{"type": "string", "var": "$Path.enrollmentAccountName", "options": ["enrollment-account-name", "enrollment-account-object-id"], "required": true, "group": "", "help": {"short": "The name of the enrollment account to which the subscription will be billed."}}, {"type": "object", "var": "$body.additionalParameters", "options": ["additional-parameters"], "group": "", "help": {"short": "Additional, untyped parameters to support custom subscription creation scenarios."}, "additionalProps": {"item": {"type": "object", "additionalProps": {"anyType": true}}}}, {"type": "string", "var": "$body.displayName", "options": ["display-name"], "group": "", "help": {"short": "The display name of the subscription."}}, {"type": "string", "var": "$body.offerType", "options": ["offer-type"], "group": "", "help": {"short": "The offer type of the subscription. For example, MS-AZR-0017P(EnterpriseAgreement) and MS-AZR-0148P(EnterpriseAgreement devTest) are available. Allowed values: MS-AZR-0017P, MS-AZR-0148P, MS-AZR-USGOV-0015P, MS-AZR-USGOV-0017P, MS-AZR-USGOV-0148P."}, "enum": {"items": [{"name": "MS-AZR-0017P", "value": "MS-AZR-0017P"}, {"name": "MS-AZR-0148P", "value": "MS-AZR-0148P"}, {"name": "MS-AZR-USGOV-0015P", "value": "MS-AZR-USGOV-0015P"}, {"name": "MS-AZR-USGOV-0017P", "value": "MS-AZR-USGOV-0017P"}, {"name": "MS-AZR-USGOV-0148P", "value": "MS-AZR-USGOV-0148P"}]}}, {"type": "array<object>", "var": "$body.owners", "options": ["owners"], "group": "", "help": {"short": "The list of principals that should be granted Owner access on the subscription. Principals should be of type User, Service Principal or Security Group."}, "item": {"type": "object", "args": [{"type": "string", "var": "$body.owners[].objectId", "options": ["object-id"], "required": true, "help": {"short": "Object id of the Principal"}}]}}]}], "operations": [{"longRunning": {"finalStateVia": "azure-async-operation"}, "operationId": "SubscriptionFactory_CreateSubscriptionInEnrollmentAccount", "http": {"path": "/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountName}/providers/Microsoft.Subscription/createSubscription", "request": {"method": "post", "path": {"params": [{"type": "string", "name": "enrollmentAccountName", "arg": "$Path.enrollmentAccountName", "required": true}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2018-03-01-preview"}, "type": "string", "name": "api-version", "required": true}]}, "body": {"json": {"schema": {"type": "object", "name": "body", "required": true, "props": [{"type": "object", "name": "additionalParameters", "arg": "$body.additionalParameters", "additionalProps": {"item": {"type": "object", "additionalProps": {"anyType": true}}}}, {"type": "string", "name": "displayName", "arg": "$body.displayName"}, {"type": "string", "name": "offerType", "arg": "$body.offerType", "enum": {"items": [{"value": "MS-AZR-0017P"}, {"value": "MS-AZR-0148P"}, {"value": "MS-AZR-USGOV-0015P"}, {"value": "MS-AZR-USGOV-0017P"}, {"value": "MS-AZR-USGOV-0148P"}]}}, {"type": "array<object>", "name": "owners", "arg": "$body.owners", "item": {"type": "object", "props": [{"type": "string", "name": "objectId", "arg": "$body.owners[].objectId", "required": true}]}}], "clientFlatten": true}}}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"type": "string", "name": "subscriptionLink"}]}}}}, {"statusCode": [202], "header": {"items": [{"name": "Location"}, {"name": "Retry-After"}]}}, {"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,109 @@
<?xml version='1.0' encoding='utf-8'?>
<CodeGen plane="mgmt-plane">
<resource id="/providers/microsoft.billing/enrollmentaccounts/{}/providers/microsoft.subscription/createsubscription" version="2018-03-01-preview" swagger="mgmt-plane/subscription/ResourceProviders/Microsoft.Subscription/Paths/L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmlsbGluZy9lbnJvbGxtZW50QWNjb3VudHMve2Vucm9sbG1lbnRBY2NvdW50TmFtZX0vcHJvdmlkZXJzL01pY3Jvc29mdC5TdWJzY3JpcHRpb24vY3JlYXRlU3Vic2NyaXB0aW9u/V/MjAxOC0wMy0wMS1wcmV2aWV3"/>
<commandGroup name="account">
<command name="create" version="2018-03-01-preview" confirmation="">
<resource id="/providers/microsoft.billing/enrollmentaccounts/{}/providers/microsoft.subscription/createsubscription" version="2018-03-01-preview" swagger="mgmt-plane/subscription/ResourceProviders/Microsoft.Subscription/Paths/L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmlsbGluZy9lbnJvbGxtZW50QWNjb3VudHMve2Vucm9sbG1lbnRBY2NvdW50TmFtZX0vcHJvdmlkZXJzL01pY3Jvc29mdC5TdWJzY3JpcHRpb24vY3JlYXRlU3Vic2NyaXB0aW9u/V/MjAxOC0wMy0wMS1wcmV2aWV3"/>
<argGroup name="">
<arg type="string" var="$Path.enrollmentAccountName" options="enrollment-account-object-id enrollment-account-name" required="True" group="">
<help short="The name of the enrollment account to which the subscription will be billed."/>
</arg>
<arg type="object" var="$body.additionalParameters" options="additional-parameters" group="">
<help short="Additional, untyped parameters to support custom subscription creation scenarios."/>
<additionalProp>
<item type="object">
<additionalProp anyType="True"/>
</item>
</additionalProp>
</arg>
<arg type="string" var="$body.displayName" options="display-name" group="">
<help short="The display name of the subscription."/>
</arg>
<arg type="string" var="$body.offerType" options="offer-type" group="">
<help short="The offer type of the subscription. For example, MS-AZR-0017P(EnterpriseAgreement) and MS-AZR-0148P(EnterpriseAgreement devTest) are available. Allowed values: MS-AZR-0017P, MS-AZR-0148P, MS-AZR-USGOV-0015P, MS-AZR-USGOV-0017P, MS-AZR-USGOV-0148P."/>
<enum>
<item name="MS-AZR-0017P" value="&quot;MS-AZR-0017P&quot;"/>
<item name="MS-AZR-0148P" value="&quot;MS-AZR-0148P&quot;"/>
<item name="MS-AZR-USGOV-0015P" value="&quot;MS-AZR-USGOV-0015P&quot;"/>
<item name="MS-AZR-USGOV-0017P" value="&quot;MS-AZR-USGOV-0017P&quot;"/>
<item name="MS-AZR-USGOV-0148P" value="&quot;MS-AZR-USGOV-0148P&quot;"/>
</enum>
</arg>
<arg type="array<object>" var="$body.owners" options="owners" group="">
<help short="The list of principals that should be granted Owner access on the subscription. Principals should be of type User, Service Principal or Security Group."/>
<item type="object">
<arg type="string" var="$body.owners[].objectId" options="object-id" required="True">
<help short="Object id of the Principal"/>
</arg>
</item>
</arg>
</argGroup>
<operation operationId="SubscriptionFactory_CreateSubscriptionInEnrollmentAccount">
<longRunning finalStateVia="azure-async-operation"/>
<http path="/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountName}/providers/Microsoft.Subscription/createSubscription">
<request method="post">
<path>
<param type="string" name="enrollmentAccountName" arg="$Path.enrollmentAccountName" 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>
<body>
<json>
<schema type="object" name="body" required="True" clientFlatten="True">
<prop type="object" name="additionalParameters" arg="$body.additionalParameters">
<additionalProp>
<item type="object">
<additionalProp anyType="True"/>
</item>
</additionalProp>
</prop>
<prop type="string" name="displayName" arg="$body.displayName"/>
<prop type="string" name="offerType" arg="$body.offerType">
<enum>
<item value="&quot;MS-AZR-0017P&quot;"/>
<item value="&quot;MS-AZR-0148P&quot;"/>
<item value="&quot;MS-AZR-USGOV-0015P&quot;"/>
<item value="&quot;MS-AZR-USGOV-0017P&quot;"/>
<item value="&quot;MS-AZR-USGOV-0148P&quot;"/>
</enum>
</prop>
<prop type="array<object>" name="owners" arg="$body.owners">
<item type="object">
<prop type="string" name="objectId" arg="$body.owners[].objectId" required="True"/>
</item>
</prop>
</schema>
</json>
</body>
</request>
<response statusCode="200">
<body>
<json var="$Instance">
<schema type="object">
<prop type="string" name="subscriptionLink"/>
</schema>
</json>
</body>
</response>
<response statusCode="202">
<header>
<item name="Location"/>
<item name="Retry-After"/>
</header>
</response>
<response isError="True">
<body>
<json>
<schema type="@ODataV4Format"/>
</json>
</body>
</response>
</http>
</operation>
<output type="object" ref="$Instance" clientFlatten="True"/>
</command>
</commandGroup>
</CodeGen>

0 comments on commit 64a022b

Please sign in to comment.