Skip to content

Commit

Permalink
Alias Put Subscription API (Azure#10205)
Browse files Browse the repository at this point in the history
* Alias Put API

* Update subscriptions.json

* Added List API

* Feedback update

* Update subscriptions.json

* updated

* Update subscriptions.json

* Update deleteAlias.json

* Update subscriptions.json

* Update subscriptions.json
  • Loading branch information
navysingla authored and 00Kai0 committed Oct 12, 2020
1 parent d762861 commit 249e2c8
Show file tree
Hide file tree
Showing 5 changed files with 353 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parameters": {
"aliasName": "aliasForNewSub",
"api-version": "2019-10-01-preview",
"body": {
"properties": {
"displayName": "Contoso MCA subscription",
"billingScope": "/providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/billingProfiles/PE2Q-NOIT-BG7-TGB/invoiceSections/MTT4-OBS7-PJA-TGB",
"workloadType": "Production"
}
}
},
"responses": {
"200": {
"body": {
"id": "/providers/Microsoft.Subscription/aliases/aliasForNewSub",
"name": "aliasForNewSub",
"type": "Microsoft.Subscription/aliases",
"properties": {
"subscriptionId": "subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05"
}
}
},
"201": {
"body": {
"id": "/providers/Microsoft.Subscription/aliases/aliasForNewSub",
"name": "aliasForNewSub",
"type": "Microsoft.Subscription/aliases",
"properties": {
"subscriptionId": "subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"parameters": {
"aliasName": "aliasForNewSub",
"api-version": "2019-10-01-preview"
},
"responses": {
"200": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"parameters": {
"aliasName": "aliasForNewSub",
"api-version": "2019-10-01-preview"
},
"responses": {
"200": {
"body": {
"id": "/providers/Microsoft.Subscription/aliases/aliasForNewSub",
"name": "aliasForNewSub",
"type": "Microsoft.Subscription/aliases",
"properties": {
"subscriptionId": "subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"api-version": "2019-10-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/providers/Microsoft.Subscription/aliases/aliasForNewSub",
"name": "aliasForNewSub",
"type": "Microsoft.Subscription/aliases",
"properties": {
"subscriptionId": "subscriptions/291bba3f-e0a5-47bc-a099-3bdcb2a50a05"
}
}
],
"nextLink": null
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,146 @@
}
]
}
},
"/providers/Microsoft.Subscription/aliases/{aliasName}": {
"put": {
"description": "Create Alias Subscription.",
"operationId": "Subscription_CreateAlias",
"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/PutAliasResponse"
}
},
"201": {
"description": "Accepted. Subscription creation is in progress.",
"schema": {
"$ref": "#/definitions/PutAliasResponse"
}
},
"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": "Subscription_GetAlias",
"x-ms-examples": {
"GetAlias": {
"$ref": "./examples/getAlias.json"
}
},
"responses": {
"200": {
"description": "Subscription details.",
"schema": {
"$ref": "#/definitions/PutAliasResponse"
}
},
"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": "Subscription_DeleteAlias",
"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": "Get Alias Subscription.",
"operationId": "Subscription_ListAlias",
"x-ms-examples": {
"GetAlias": {
"$ref": "./examples/listAlias.json"
}
},
"responses": {
"200": {
"description": "Subscription details.",
"schema": {
"$ref": "#/definitions/PutAliasListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorResponseBody"
}
}
},
"parameters": [
{
"$ref": "#/parameters/apiVersionParameter"
}
]
}
}
},
"definitions": {
Expand All @@ -409,6 +549,16 @@
}
}
},
"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"
}
}
},
"CanceledSubscriptionId": {
"description": "The ID of the canceled subscription",
"properties": {
Expand Down Expand Up @@ -608,6 +758,116 @@
"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.",
"required": [
"displayName",
"workloadType",
"billingScope"
],
"properties": {
"displayName": {
"description": "The friendly name of the subscription.",
"type": "string"
},
"workloadType": {
"description": "The workload type of the subscription. It can be either Production or DevTest.",
"type": "string",
"x-ms-enum": {
"name": "workloadType",
"modelAsString": true
},
"enum": [
"Production",
"DevTest"
]
},
"billingScope": {
"description": "Determines whether subscription is fieldLed, partnerLed or LegacyEA",
"type": "string"
},
"subscriptionId": {
"description": "This parameter can be used to create alias for existing subscription Id",
"type": "string"
}
}
},
"PutAliasResponse": {
"description": "Subscription Information with the alias.",
"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/PutAliasResponseProperties",
"description": "Put Alias response properties."
}
},
"x-ms-azure-resource": true
},
"PutAliasResponseProperties": {
"description": "Put subscription creation result properties.",
"properties": {
"subscriptionId": {
"description": "Newly created subscription Id.",
"readOnly": true,
"type": "string"
},
"provisioningState": {
"type": "string",
"description": "The provisioning state of the resource.",
"enum": [
"Accepted",
"Succeeded",
"Failed"
],
"x-ms-enum": {
"name": "ProvisioningState",
"modelAsString": true
}
}
}
},
"PutAliasListResult": {
"description": "The list of aliases.",
"properties": {
"value": {
"description": "The list of alias.",
"type": "array",
"readOnly": true,
"items": {
"$ref": "#/definitions/PutAliasResponse"
}
},
"nextLink": {
"description": "The link (url) to the next page of results.",
"type": "string",
"readOnly": true
}
}
}
},
"parameters": {
Expand Down Expand Up @@ -635,6 +895,14 @@
"schema": {
"$ref": "#/definitions/SubscriptionName"
}
},
"aliasNameParameter": {
"name": "aliasName",
"x-ms-parameter-location": "method",
"in": "path",
"required": true,
"type": "string",
"description": "Alias Name"
}
},
"security": [
Expand Down

0 comments on commit 249e2c8

Please sign in to comment.