diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptOwnershipStatus.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptOwnershipStatus.json new file mode 100644 index 000000000000..3c42d48cdd35 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptOwnershipStatus.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "subscriptionId": "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "subscriptionId": "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + "acceptOwnershipState": "Pending", + "billingOwner": "abc@test.com", + "subscriptionTenantId": "6c541ca7-1cab-4ea0-adde-6305e1d534e2", + "displayName": "Test Subscription", + "tags": { + "tag1": "TagValue1" + } + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptSubscriptionOwnership.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptSubscriptionOwnership.json new file mode 100644 index 000000000000..835a871f325b --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/acceptSubscriptionOwnership.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "subscriptionId": "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + "api-version": "2021-10-01", + "body": { + "properties": { + "displayName": "Test Subscription", + "managementGroupId": null, + "tags": { + "tag1": "Messi", + "tag2": "Ronaldo", + "tag3": "Lebron" + } + } + } + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.Subscription/subscriptionOperations/ODdmYTU0MDktODc5YS00ZTEzLTg2MWItNTQ4ZjYxNzBlOTQw?api-version=2021-10-01", + "Retry-After": 8 + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/cancelSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/cancelSubscription.json new file mode 100644 index 000000000000..fa4488fe3ba5 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/cancelSubscription.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "83aa47df-e3e9-49ff-877b-94304bf3d3ad", + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "value": "83aa47df-e3e9-49ff-877b-94304bf3d3ad" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/changeTenantPolicy.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/changeTenantPolicy.json new file mode 100644 index 000000000000..e32e2da8778f --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/changeTenantPolicy.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "api-version": "2021-10-01", + "body": { + "blockSubscriptionsLeavingTenant": true, + "blockSubscriptionsIntoTenant": true, + "exemptedPrincipals": [ + "e879cf0f-2b4d-5431-109a-f72fc9868693", + "9792da87-c97b-410d-a97d-27021ba09ce6" + ] + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.Subscription/policies/default", + "name": "default", + "type": "providers/Microsoft.Subscription/policies", + "properties": { + "policyId": "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + "blockSubscriptionsLeavingTenant": true, + "blockSubscriptionsIntoTenant": true, + "exemptedPrincipals": [ + "e879cf0f-2b4d-5431-109a-f72fc9868693", + "9792da87-c97b-410d-a97d-27021ba09ce6" + ] + } + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/createAlias.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/createAlias.json new file mode 100644 index 000000000000..08dd4923913f --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/createAlias.json @@ -0,0 +1,74 @@ +{ + "parameters": { + "aliasName": "aliasForNewSub", + "api-version": "2021-10-01", + "body": { + "properties": { + "displayName": "Test Subscription", + "workload": "Production", + "billingScope": "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH", + "subscriptionId": null, + "additionalProperties": { + "managementGroupId": null, + "subscriptionTenantId": "66f6e4d6-07dc-4aea-94ea-e12d3026a3c8", + "subscriptionOwnerId": "f09b39eb-c496-482c-9ab9-afd799572f4c", + "tags": { + "tag1": "Messi", + "tag2": "Ronaldo", + "tag3": "Lebron" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "subscriptionId": "e2283d0f-acad-4904-b803-627dd74cc072", + "displayName": "Test Subscription", + "provisioningState": "Accepted", + "acceptOwnershipUrl": "/providers/Microsoft.Subscription/e2283d0f-acad-4904-b803-627dd74cc072/acceptOwnership", + "acceptOwnershipState": "Pending", + "billingScope": "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH", + "workload": "Production", + "resellerId": null, + "subscriptionOwnerId": "f09b39eb-c496-482c-9ab9-afd799572f4c", + "managementGroupId": null, + "tags": { + "tag1": "Messi", + "tag2": "Ronaldo", + "tag3": "Lebron" + } + } + } + }, + "201": { + "body": { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "subscriptionId": "e2283d0f-acad-4904-b803-627dd74cc072", + "displayName": "Test Subscription", + "provisioningState": "Accepted", + "acceptOwnershipUrl": "/providers/Microsoft.Subscription/e2283d0f-acad-4904-b803-627dd74cc072/acceptOwnership", + "acceptOwnershipState": "Pending", + "billingScope": "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH", + "workload": "Production", + "resellerId": null, + "subscriptionOwnerId": "f09b39eb-c496-482c-9ab9-afd799572f4c", + "managementGroupId": null, + "tags": { + "tag1": "Messi", + "tag2": "Ronaldo", + "tag3": "Lebron" + } + } + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json new file mode 100644 index 000000000000..8f4e2f439138 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "aliasName": "aliasForNewSub", + "api-version": "2021-10-01" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/enableSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/enableSubscription.json new file mode 100644 index 000000000000..a037a59b54c7 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/enableSubscription.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "7948bcee-488c-47ce-941c-38e20ede803d", + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "value": "7948bcee-488c-47ce-941c-38e20ede803d" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getAlias.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getAlias.json new file mode 100644 index 000000000000..ac449d4fc8f8 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getAlias.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "aliasName": "aliasForNewSub", + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "subscriptionId": "e2283d0f-acad-4904-b803-627dd74cc072", + "displayName": "Test Subscription", + "provisioningState": "Accepted", + "acceptOwnershipUrl": "/providers/Microsoft.Subscription/e2283d0f-acad-4904-b803-627dd74cc072/acceptOwnership", + "acceptOwnershipState": "Pending", + "billingScope": "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH", + "workload": "Production", + "resellerId": null, + "subscriptionOwnerId": "f09b39eb-c496-482c-9ab9-afd799572f4c", + "managementGroupId": null, + "tags": { + "tag1": "Messi", + "tag2": "Ronaldo", + "tag3": "Lebron" + } + } + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getBillingAccountPolicy.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getBillingAccountPolicy.json new file mode 100644 index 000000000000..4226b82f1905 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getBillingAccountPolicy.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "billingAccountId": "testBillingAccountId", + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.Subscription/Policies/policyForBillingAccount", + "name": "testBillingAccountId", + "type": "Microsoft.Subscription/policies", + "properties": { + "serviceTenants": [ + { + "tenantName": "testServiceTenant", + "tenantId": "b8ed2088-c458-4e77-bd61-9e048d96a1c0" + } + ], + "allowTransfers": true + } + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getOperations.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getOperations.json new file mode 100644 index 000000000000..093d60d70652 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getOperations.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.Subscription/createOperation/action", + "isDataAction": false, + "display": { + "provider": "Microsoft Subscription", + "resource": "Resources", + "operation": "Create a subscription" + } + } + ] + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicy.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicy.json new file mode 100644 index 000000000000..319d10f6c60d --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicy.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "id": "providers/Microsoft.Subscription/policies/default", + "name": "default", + "type": "providers/Microsoft.Subscription/policies", + "properties": { + "policyId": "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + "blockSubscriptionsLeavingTenant": true, + "blockSubscriptionsIntoTenant": true, + "exemptedPrincipals": [ + "e879cf0f-2b4d-5431-109a-f72fc9868693", + "9792da87-c97b-410d-a97d-27021ba09ce6" + ] + } + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicyList.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicyList.json new file mode 100644 index 000000000000..50264605a9ea --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicyList.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Subscription/policies/default", + "name": "default", + "type": "providers/Microsoft.Subscription/policies", + "properties": { + "policyId": "291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + "blockSubscriptionsLeavingTenant": true, + "blockSubscriptionsIntoTenant": true, + "exemptedPrincipals": [ + "e879cf0f-2b4d-5431-109a-f72fc9868693", + "9792da87-c97b-410d-a97d-27021ba09ce6" + ] + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/listAlias.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/listAlias.json new file mode 100644 index 000000000000..9f58aa5887f7 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/listAlias.json @@ -0,0 +1,58 @@ +{ + "parameters": { + "api-version": "2021-10-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "subscriptionId": "e2283d0f-acad-4904-b803-627dd74cc072", + "displayName": "Test Subscription", + "provisioningState": "Accepted", + "acceptOwnershipUrl": "/providers/Microsoft.Subscription/e2283d0f-acad-4904-b803-627dd74cc072/acceptOwnership", + "acceptOwnershipState": "Pending", + "billingScope": "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH", + "workload": "Production", + "resellerId": null, + "subscriptionOwnerId": "f09b39eb-c496-482c-9ab9-afd799572f4c", + "managementGroupId": null, + "tags": { + "tag1": "Messi", + "tag2": "Ronaldo", + "tag3": "Lebron" + } + } + }, + { + "id": "string", + "name": "string", + "type": "string", + "properties": { + "subscriptionId": "091c6e56-a835-4422-a082-0427308ca9ee", + "displayName": "Test Subscription 2", + "provisioningState": "Accepted", + "acceptOwnershipUrl": "/providers/Microsoft.Subscription/091c6e56-a835-4422-a082-0427308ca9ee/acceptOwnership", + "acceptOwnershipState": "Pending", + "billingScope": "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH", + "workload": "Production", + "resellerId": null, + "subscriptionOwnerId": "f09b39eb-c496-482c-9ab9-afd799572f4c", + "managementGroupId": null, + "tags": { + "tag1": "Messi2", + "tag2": "Ronaldo2", + "tag3": "Lebron2" + } + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/renameSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/renameSubscription.json new file mode 100644 index 000000000000..aca74fcc469d --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/renameSubscription.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "subscriptionId": "83aa47df-e3e9-49ff-877b-94304bf3d3ad", + "api-version": "2021-10-01", + "body": { + "subscriptionName": "Test Sub" + } + }, + "responses": { + "200": { + "body": { + "value": "83aa47df-e3e9-49ff-877b-94304bf3d3ad" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json new file mode 100644 index 000000000000..164ffff06e67 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/subscriptions.json @@ -0,0 +1,1135 @@ +{ + "swagger": "2.0", + "info": { + "version": "2021-10-01", + "title": "SubscriptionClient", + "description": "Subscription client provides an interface to create and manage Azure subscriptions programmatically." + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel": { + "post": { + "operationId": "Subscription_Cancel", + "x-ms-examples": { + "cancelSubscription": { + "$ref": "./examples/cancelSubscription.json" + } + }, + "description": "The operation to cancel a subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/CanceledSubscriptionId" + } + }, + "default": { + "description": "Describes the error if the operation is not successful.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename": { + "post": { + "operationId": "Subscription_Rename", + "x-ms-examples": { + "renameSubscription": { + "$ref": "./examples/renameSubscription.json" + } + }, + "description": "The operation to rename a subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/subscriptionNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/RenamedSubscriptionId" + } + }, + "default": { + "description": "Describes the error if the operation is not successful.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable": { + "post": { + "operationId": "Subscription_Enable", + "x-ms-examples": { + "enableSubscription": { + "$ref": "./examples/enableSubscription.json" + } + }, + "description": "The operation to enable a subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/EnabledSubscriptionId" + } + }, + "default": { + "description": "Describes the error if the operation is not successful.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + } + } + }, + "/providers/Microsoft.Subscription/operations": { + "get": { + "description": "Lists all of the available Microsoft.Subscription API operations.", + "operationId": "Operations_List", + "x-ms-examples": { + "getOperations": { + "$ref": "./examples/getOperations.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Subscription/aliases/{aliasName}": { + "put": { + "description": "Create Alias Subscription.", + "operationId": "Alias_Create", + "x-ms-examples": { + "CreateAlias": { + "$ref": "./examples/createAlias.json" + } + }, + "x-ms-long-running-operation": true, + "responses": { + "200": { + "description": "Normal response for a successful query.", + "schema": { + "$ref": "#/definitions/SubscriptionAliasResponse" + } + }, + "201": { + "description": "Accepted. Subscription creation is in progress.", + "schema": { + "$ref": "#/definitions/SubscriptionAliasResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/aliasNameParameter" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PutAliasRequest" + } + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + }, + "get": { + "description": "Get Alias Subscription.", + "operationId": "Alias_Get", + "x-ms-examples": { + "GetAlias": { + "$ref": "./examples/getAlias.json" + } + }, + "responses": { + "200": { + "description": "Subscription details.", + "schema": { + "$ref": "#/definitions/SubscriptionAliasResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/aliasNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + }, + "delete": { + "description": "Delete Alias.", + "operationId": "Alias_Delete", + "x-ms-examples": { + "DeleteAlias": { + "$ref": "./examples/deleteAlias.json" + } + }, + "responses": { + "200": { + "description": "Deleted the alias" + }, + "204": { + "description": "Alias does not exist" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/aliasNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, + "/providers/Microsoft.Subscription/aliases": { + "get": { + "description": "List Alias Subscription.", + "operationId": "Alias_List", + "x-ms-examples": { + "ListAlias": { + "$ref": "./examples/listAlias.json" + } + }, + "responses": { + "200": { + "description": "Subscription details.", + "schema": { + "$ref": "#/definitions/SubscriptionAliasListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, + "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnership": { + "post": { + "description": "Accept subscription ownership.", + "operationId": "Subscription_AcceptOwnership", + "x-ms-examples": { + "AcceptOwnership": { + "$ref": "./examples/acceptSubscriptionOwnership.json" + } + }, + "x-ms-long-running-operation": true, + "responses": { + "202": { + "description": "Accept Subscription ownership is in progress", + "headers": { + "Location": { + "description": "GET this URL to retrieve the status of the asynchronous operation.", + "type": "string" + }, + "Retry-After": { + "description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.", + "type": "integer", + "format": "int32" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AcceptOwnershipRequest" + } + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, + "/providers/Microsoft.Subscription/{subscriptionId}/acceptOwnershipStatus": { + "get": { + "description": "Accept subscription ownership status.", + "operationId": "Subscription_AcceptOwnershipStatus", + "x-ms-examples": { + "AcceptOwnershipStatus": { + "$ref": "./examples/acceptOwnershipStatus.json" + } + }, + "responses": { + "200": { + "description": "Subscription details.", + "schema": { + "$ref": "#/definitions/AcceptOwnershipStatusResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, + "/providers/Microsoft.Subscription/policies/default": { + "put": { + "description": "Create or Update Subscription tenant policy for user's tenant.", + "operationId": "SubscriptionPolicy_AddUpdatePolicyForTenant", + "x-ms-examples": { + "TenantPolicy": { + "$ref": "./examples/changeTenantPolicy.json" + } + }, + "responses": { + "201": { + "description": "Subscription tenant policy has been successfully created/updated.", + "schema": { + "$ref": "#/definitions/GetTenantPolicyResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PutTenantPolicyRequestProperties" + } + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + }, + "get": { + "description": "Get the subscription tenant policy for the user's tenant.", + "operationId": "SubscriptionPolicy_GetPolicyForTenant", + "x-ms-examples": { + "getTenantPolicy": { + "$ref": "./examples/getTenantPolicy.json" + } + }, + "responses": { + "200": { + "description": "Subscription tenant policy details for user's tenant.", + "schema": { + "$ref": "#/definitions/GetTenantPolicyResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, + "/providers/Microsoft.Subscription/policies": { + "get": { + "description": "Get the subscription tenant policy for the user's tenant.", + "operationId": "SubscriptionPolicy_ListPolicyForTenant", + "x-ms-examples": { + "getTenantPolicyList": { + "$ref": "./examples/getTenantPolicyList.json" + } + }, + "responses": { + "200": { + "description": "Subscription tenant policy details for user's tenant.", + "schema": { + "$ref": "#/definitions/GetTenantPolicyListResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default": { + "get": { + "description": "Get Billing Account Policy.", + "operationId": "BillingAccount_GetPolicy", + "x-ms-examples": { + "GetBillingAccountPolicy": { + "$ref": "./examples/getBillingAccountPolicy.json" + } + }, + "responses": { + "200": { + "description": "Normal response for a successful query.", + "schema": { + "$ref": "#/definitions/BillingAccountPoliciesResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + } + }, + "definitions": { + "ErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "ErrorResponseBody": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorResponse" + }, + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "CanceledSubscriptionId": { + "description": "The ID of the canceled subscription", + "type": "object", + "properties": { + "value": { + "description": "The ID of the canceled subscription", + "type": "string", + "readOnly": true + } + } + }, + "RenamedSubscriptionId": { + "description": "The ID of the subscriptions that is being renamed", + "type": "object", + "properties": { + "value": { + "description": "The ID of the subscriptions that is being renamed", + "type": "string", + "readOnly": true + } + } + }, + "EnabledSubscriptionId": { + "description": "The ID of the subscriptions that is being enabled", + "type": "object", + "properties": { + "value": { + "description": "The ID of the subscriptions that is being enabled", + "type": "string", + "readOnly": true + } + } + }, + "SubscriptionName": { + "type": "object", + "description": "The new name of the subscription.", + "properties": { + "subscriptionName": { + "type": "string", + "description": "New subscription name" + } + } + }, + "OperationListResult": { + "description": "Result of the request to list operations. It contains a list of operations and a URL link to get the next set of results.", + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "description": "List of operations." + }, + "nextLink": { + "type": "string", + "description": "URL to get the next set of operation list results if there are any." + } + } + }, + "Operation": { + "description": "REST API operation", + "type": "object", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}", + "type": "string" + }, + "isDataAction": { + "description": "Indicates whether the operation is a data action", + "type": "boolean" + }, + "display": { + "description": "The object that represents the operation.", + "type": "object", + "properties": { + "provider": { + "description": "Service provider: Microsoft.Subscription", + "type": "string" + }, + "resource": { + "description": "Resource on which the operation is performed: Profile, endpoint, etc.", + "type": "string" + }, + "operation": { + "description": "Operation type: Read, write, delete, etc.", + "type": "string" + }, + "description": { + "description": "Localized friendly description for the operation", + "type": "string" + } + } + } + } + }, + "PutAliasRequest": { + "description": "The parameters required to create a new subscription.", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/PutAliasRequestProperties", + "description": "Put alias request properties." + } + } + }, + "PutAliasRequestProperties": { + "description": "Put subscription properties.", + "type": "object", + "properties": { + "displayName": { + "description": "The friendly name of the subscription.", + "type": "string" + }, + "workload": { + "$ref": "#/definitions/Workload" + }, + "billingScope": { + "$ref": "#/definitions/BillingScope" + }, + "subscriptionId": { + "description": "This parameter can be used to create alias for existing subscription Id", + "type": "string" + }, + "resellerId": { + "description": "Reseller Id", + "type": "string" + }, + "additionalProperties": { + "$ref": "#/definitions/PutAliasRequestAdditionalProperties", + "description": "Put alias request additional properties." + } + } + }, + "PutAliasRequestAdditionalProperties": { + "description": "Put subscription additional properties.", + "type": "object", + "properties": { + "managementGroupId": { + "description": "Management group Id for the subscription.", + "type": "string" + }, + "subscriptionTenantId": { + "description": "Tenant Id of the subscription", + "type": "string" + }, + "subscriptionOwnerId": { + "description": "Owner Id of the subscription", + "type": "string" + }, + "tags": { + "description": "Tags for the subscription", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "SubscriptionAliasResponse": { + "description": "Subscription Information with the alias.", + "type": "object", + "properties": { + "id": { + "description": "Fully qualified ID for the alias resource.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Alias ID.", + "readOnly": true, + "type": "string" + }, + "type": { + "description": "Resource type, Microsoft.Subscription/aliases.", + "readOnly": true, + "type": "string" + }, + "properties": { + "$ref": "#/definitions/SubscriptionAliasResponseProperties", + "description": "Subscription Alias response properties." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true + } + }, + "x-ms-azure-resource": true + }, + "SubscriptionAliasResponseProperties": { + "description": "Put subscription creation result properties.", + "type": "object", + "properties": { + "subscriptionId": { + "description": "Newly created subscription Id.", + "readOnly": true, + "type": "string" + }, + "displayName": { + "description": "The display name of the subscription.", + "type": "string" + }, + "provisioningState": { + "type": "string", + "description": "The provisioning state of the resource.", + "enum": [ + "Accepted", + "Succeeded", + "Failed" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + }, + "acceptOwnershipUrl": { + "description": "Url to accept ownership of the subscription.", + "type": "string", + "readOnly": true + }, + "acceptOwnershipState": { + "$ref": "#/definitions/AcceptOwnershipState" + }, + "billingScope": { + "$ref": "#/definitions/BillingScope" + }, + "workload": { + "$ref": "#/definitions/Workload" + }, + "resellerId": { + "description": "Reseller Id", + "type": "string" + }, + "subscriptionOwnerId": { + "description": "Owner Id of the subscription", + "type": "string" + }, + "managementGroupId": { + "description": "The Management Group Id.", + "type": "string" + }, + "tags": { + "description": "Tags for the subscription", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "SubscriptionAliasListResult": { + "description": "The list of aliases.", + "type": "object", + "properties": { + "value": { + "description": "The list of alias.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/SubscriptionAliasResponse" + } + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "AcceptOwnershipRequest": { + "description": "The parameters required to accept subscription ownership.", + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/AcceptOwnershipRequestProperties", + "description": "Accept subscription ownership request properties." + } + } + }, + "AcceptOwnershipRequestProperties": { + "description": "Accept subscription ownership request properties.", + "type": "object", + "required": [ + "displayName" + ], + "properties": { + "displayName": { + "description": "The friendly name of the subscription.", + "type": "string" + }, + "managementGroupId": { + "description": "Management group Id for the subscription.", + "type": "string" + }, + "tags": { + "description": "Tags for the subscription", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "AcceptOwnershipStatusResponse": { + "description": "Subscription Accept Ownership Response", + "type": "object", + "properties": { + "subscriptionId": { + "description": "Newly created subscription Id.", + "readOnly": true, + "type": "string" + }, + "acceptOwnershipState": { + "$ref": "#/definitions/AcceptOwnershipState" + }, + "billingOwner": { + "description": "UPN of the billing owner", + "readOnly": true, + "type": "string" + }, + "subscriptionTenantId": { + "description": "Tenant Id of the subscription", + "type": "string" + }, + "displayName": { + "description": "The display name of the subscription.", + "type": "string" + }, + "tags": { + "description": "Tags for the subscription", + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "PutTenantPolicyRequestProperties": { + "description": "Put tenant policy request properties.", + "type": "object", + "properties": { + "blockSubscriptionsLeavingTenant": { + "description": "Blocks the leaving of subscriptions from user's tenant.", + "type": "boolean" + }, + "blockSubscriptionsIntoTenant": { + "description": "Blocks the entering of subscriptions into user's tenant.", + "type": "boolean" + }, + "exemptedPrincipals": { + "description": "List of user objectIds that are exempted from the set subscription tenant policies for the user's tenant.", + "type": "array", + "items": { + "format": "uuid", + "type": "string", + "example": "00000000-0000-0000-0000-000000000000" + } + } + } + }, + "GetTenantPolicyResponse": { + "description": "Tenant policy Information.", + "type": "object", + "properties": { + "id": { + "description": "Policy Id.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Policy name.", + "readOnly": true, + "type": "string" + }, + "type": { + "description": "Resource type.", + "readOnly": true, + "type": "string" + }, + "properties": { + "$ref": "#/definitions/TenantPolicy", + "description": "Tenant policy properties." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true + } + }, + "x-ms-azure-resource": true + }, + "GetTenantPolicyListResponse": { + "description": "Tenant policy information list.", + "type": "object", + "properties": { + "value": { + "description": "The list of tenant policies.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/GetTenantPolicyResponse" + } + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "BillingAccountPoliciesResponse": { + "description": "Billing account policies information.", + "type": "object", + "properties": { + "id": { + "description": "Fully qualified ID for the policy.", + "readOnly": true, + "type": "string" + }, + "name": { + "description": "Policy name.", + "readOnly": true, + "type": "string" + }, + "type": { + "description": "Resource type.", + "readOnly": true, + "type": "string" + }, + "properties": { + "$ref": "#/definitions/BillingAccountPoliciesResponseProperties", + "description": "Billing account policies response properties." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true + } + }, + "x-ms-azure-resource": true + }, + "BillingAccountPoliciesResponseProperties": { + "description": "Put billing account policies response properties.", + "type": "object", + "properties": { + "serviceTenants": { + "description": "Service tenant for the billing account.", + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/ServiceTenantResponse", + "description": "Billing account service tenant." + } + }, + "allowTransfers": { + "description": "Determine if the transfers are allowed for the billing account", + "type": "boolean" + } + } + }, + "TenantPolicy": { + "description": "Tenant policy.", + "type": "object", + "properties": { + "policyId": { + "description": "Policy Id.", + "type": "string", + "readOnly": true + }, + "blockSubscriptionsLeavingTenant": { + "description": "Blocks the leaving of subscriptions from user's tenant.", + "type": "boolean" + }, + "blockSubscriptionsIntoTenant": { + "description": "Blocks the entering of subscriptions into user's tenant.", + "type": "boolean" + }, + "exemptedPrincipals": { + "description": "List of user objectIds that are exempted from the set subscription tenant policies for the user's tenant.", + "type": "array", + "items": { + "format": "uuid", + "type": "string", + "example": "00000000-0000-0000-0000-000000000000" + } + } + } + }, + "Workload": { + "description": "The workload type of the subscription. It can be either Production or DevTest.", + "type": "string", + "x-ms-enum": { + "name": "workload", + "modelAsString": true + }, + "enum": [ + "Production", + "DevTest" + ] + }, + "BillingScope": { + "description": "Billing scope of the subscription.\nFor CustomerLed and FieldLed - /billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}\nFor PartnerLed - /billingAccounts/{billingAccountName}/customers/{customerName}\nFor Legacy EA - /billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}", + "type": "string" + }, + "AcceptOwnershipState": { + "readOnly": true, + "type": "string", + "description": "The accept ownership state of the resource.", + "enum": [ + "Pending", + "Completed", + "Expired" + ], + "x-ms-enum": { + "name": "AcceptOwnership", + "modelAsString": true + } + }, + "ServiceTenantResponse": { + "description": "Billing account service tenant.", + "type": "object", + "properties": { + "tenantId": { + "description": "Service tenant id.", + "type": "string" + }, + "tenantName": { + "description": "Service tenant name.", + "type": "string" + } + } + } + }, + "parameters": { + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. Current version is 2021-10-01" + }, + "subscriptionIdParameter": { + "name": "subscriptionId", + "x-ms-parameter-location": "method", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription Id." + }, + "subscriptionNameParameter": { + "name": "body", + "x-ms-parameter-location": "method", + "in": "body", + "required": true, + "description": "Subscription Name", + "schema": { + "$ref": "#/definitions/SubscriptionName" + } + }, + "aliasNameParameter": { + "name": "aliasName", + "x-ms-parameter-location": "method", + "in": "path", + "required": true, + "type": "string", + "description": "AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation." + }, + "billingAccountIdParameter": { + "name": "billingAccountId", + "x-ms-parameter-location": "method", + "in": "path", + "required": true, + "type": "string", + "description": "Billing Account Id." + } + }, + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + } +} diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index 461dc794f01b..e7ed20ea460b 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -31,7 +31,18 @@ These are the global settings for the Subscription API. ``` yaml openapi-type: arm -tag: package-2020-09 +tag: package-2021-10 +``` + +### Tag: package-2021-10 + +These settings apply only when `--tag=package-2021-10` is specified on the command line. + +``` yaml $(tag) == 'package-2021-10' +input-file: +- Microsoft.Subscription/stable/2021-10-01/subscriptions.json +title: SubscriptionClient +description: The subscription client ``` ### Tag: package-2020-09