Skip to content

Commit

Permalink
feat(apim): Introduce gateway resource (Azure#27757)
Browse files Browse the repository at this point in the history
* WIP

* Update sample

* WIP

* Add GatewayNameParameter

* Clean up

* Update sample

* Add another sample

* Add sample for delete gateway

* Remove endpoints

* Fix typo

* Add list sample

* Clean up

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Add disclaimer

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Make it pretty 💄

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Refer to new file

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Add missing ApiManagementGatewayListResult

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Update sample reference

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Remove ApiManagementGatewayIdentity + List by operation

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Add more sample

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Latest version of common types

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Remove 200 for delete

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Formatting and re-order

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Align with spec

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Align sample with spec

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Error response from common types

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Rename SKU name

* Have seperate SKU for patch to not make it mandatory

* Remove empty required

* Improve note

* Rename schema

* Remove unused type

* sku.capacity should not be required

---------

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
  • Loading branch information
tomkerkhove authored and solankisamir committed May 9, 2024
1 parent 8af1d33 commit 25788eb
Show file tree
Hide file tree
Showing 9 changed files with 1,080 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,17 @@
"description": "Email identifier.",
"x-ms-parameter-location": "method"
},
"GatewayNameParameter": {
"name": "gatewayName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the API Management gateway.",
"minLength": 1,
"maxLength": 50,
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$",
"x-ms-parameter-location": "method"
},
"GroupIdParameter": {
"name": "groupId",
"in": "path",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"parameters": {
"gatewayName": "apimGateway1",
"resourceGroupName": "rg1",
"api-version": "2023-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"parameters": {
"properties": {
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"location": "South Central US",
"tags": {
"Name": "Contoso",
"Test": "User"
}
}
},
"responses": {
"201": {
"headers": {
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2023-09-01-preview&asyncResponse",
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1/operationresults/ZWFzdHVzOmFuZHktdGVzdGluZy0yMDIyLTA0LTAxLXByZXZpZXctNF9BY3RfODQ2ZWE4Ng==?api-version=2023-09-01-preview&asyncResponse"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1",
"name": "apimGateway1",
"type": "Microsoft.ApiManagement/gateway",
"tags": {
"api-version": "2023-09-01-preview"
},
"location": "East US",
"etag": "AAAAAAAmRAM=",
"properties": {
"provisioningState": "Created",
"targetProvisioningState": "Activating",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
},
"200": {
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/apimGateway1",
"name": "apimGateway1",
"type": "Microsoft.ApiManagement/gateways",
"tags": {
"api-version": "2023-09-01-preview"
},
"location": "East US",
"etag": "AAAAAAAmREI=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2022-07-11T18:41:01.2506031Z",
"frontend": {
"defaultHostname": "apimGateway1.eastus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"configurationApi": {
"hostname": "apimGateway1.eastus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "user@contoso.com",
"createdByType": "User",
"createdAt": "2022-07-11T18:41:00.9390609Z",
"lastModifiedBy": "user@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2022-07-11T18:41:00.9390609Z"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"parameters": {
"gatewayName": "example-gateway",
"resourceGroupName": "rg1",
"api-version": "2023-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"202": {
"headers": {
"location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateway/example-gateway/operationresults/TGV2eTExMDZtMDJfVGVybV9jMmZlY2QwMA==?api-version=2023-09-01-preview"
},
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateway/example-gateway",
"name": "example-gateway",
"type": "Microsoft.ApiManagement/gateway",
"tags": {},
"location": "West US",
"etag": "AAAAAAFfhHY=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "Deleting",
"createdAtUtc": "2016-12-20T19:41:21.5823069Z",
"frontend": {
"defaultHostname": "example-gateway.westus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"configurationApi": {
"hostname": "example-gateway.westus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
}
}
},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"parameters": {
"gatewayName": "apimService1",
"resourceGroupName": "rg1",
"api-version": "2023-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateway/example-gateway",
"name": "example-gateway",
"type": "Microsoft.ApiManagement/gateway",
"tags": {
"owner": "v-aswmoh",
"ReleaseName": "Z3"
},
"location": "East US",
"etag": "AAAAAAAWN/4=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2021-06-16T09:40:00.9453556Z",
"frontend": {
"defaultHostname": "example-gateway.eastus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"configurationApi": {
"hostname": "example-gateway.eastus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "string",
"createdByType": "User",
"createdAt": "2021-06-16T09:40:00.7106733Z",
"lastModifiedBy": "foo@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-06-20T06:33:09.6159006Z"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"parameters": {
"api-version": "2023-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/standard-gw-1",
"name": "standard-gw-1",
"type": "Microsoft.ApiManagement/gateways",
"tags": {
"owner": "v-aswmoh",
"ReleaseName": "Z3"
},
"location": "West US",
"etag": "AAAAAAAWN/4=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2021-06-16T09:40:00.9453556Z",
"frontend": {
"defaultHostname": "standard-gw-1.westus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"configurationApi": {
"hostname": "standard-gw-1.westus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "bar@contoso.com",
"createdByType": "User",
"createdAt": "2021-06-16T09:40:00.7106733Z",
"lastModifiedBy": "foo@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-06-20T06:33:09.6159006Z"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.ApiManagement/gateways/standard-gw-2",
"name": "standard-gw-2",
"type": "Microsoft.ApiManagement/gateways",
"tags": {
"Owner": "vitaliik"
},
"location": "East US",
"etag": "AAAAAAAWKwo=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2021-06-16T09:40:00.9453556Z",
"frontend": {
"defaultHostname": "standard-gw-2.eastus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn2/subnets/sn2"
}
},
"configurationApi": {
"hostname": "standard-gw-2.eastus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"parameters": {
"resourceGroupName": "rg1",
"api-version": "2023-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/standard-gw-1",
"name": "standard-gw-1",
"type": "Microsoft.ApiManagement/gateways",
"tags": {
"owner": "v-aswmoh",
"ReleaseName": "Z3"
},
"location": "West US",
"etag": "AAAAAAAWN/4=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2021-06-16T09:40:00.9453556Z",
"frontend": {
"defaultHostname": "standard-gw-1.westus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn1/subnets/sn1"
}
},
"configurationApi": {
"hostname": "standard-gw-1.westus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
},
"systemData": {
"createdBy": "bar@contoso.com",
"createdByType": "User",
"createdAt": "2021-06-16T09:40:00.7106733Z",
"lastModifiedBy": "foo@contoso.com",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-06-20T06:33:09.6159006Z"
}
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/gateways/standard-gw-2",
"name": "standard-gw-2",
"type": "Microsoft.ApiManagement/gateways",
"tags": {
"Owner": "vitaliik"
},
"location": "East US",
"etag": "AAAAAAAWKwo=",
"properties": {
"provisioningState": "Succeeded",
"targetProvisioningState": "",
"createdAtUtc": "2021-06-16T09:40:00.9453556Z",
"frontend": {
"defaultHostname": "standard-gw-2.eastus.gateway.azure-api.net"
},
"backend": {
"subnet": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vn2/subnets/sn2"
}
},
"configurationApi": {
"hostname": "standard-gw-2.eastus.configuration.gateway.azure-api.net"
}
},
"sku": {
"name": "Standard",
"capacity": 1
}
}
]
}
}
}
}
Loading

0 comments on commit 25788eb

Please sign in to comment.