Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"swagger": "2.0",
"info": {
"title": "NetworkManagementClient",
"description": "The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.",
"version": "2019-08-01"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"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"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases": {
"get": {
"operationId": "AvailableServiceAliases_List",
"description": "Gets all available service aliases for this subscription in this region.",
"parameters": [
{
"name": "location",
"in": "path",
"required": true,
"type": "string",
"description": "The location."
},
{
"$ref": "./network.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./network.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Request successful. Returns all available service aliases for the subscription in the region.",
"schema": {
"$ref": "#/definitions/AvailableServiceAliasesResult"
}
}
},
"x-ms-examples": {
"Get available service aliases": {
"$ref": "./examples/AvailableServiceAliasesList.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases": {
"get": {
"operationId": "AvailableServiceAliases_ListByResourceGroup",
"description": "Gets all available service aliases for this resource group in this region.",
"parameters": [
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group."
},
{
"name": "location",
"in": "path",
"required": true,
"type": "string",
"description": "The location."
},
{
"$ref": "./network.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "./network.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Request successful. Returns all available service aliases for the resource group in the region.",
"schema": {
"$ref": "#/definitions/AvailableServiceAliasesResult"
}
}
},
"x-ms-examples": {
"Get available service aliases in the resource group": {
"$ref": "./examples/AvailableServiceAliasesListByResourceGroup.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
}
},
"definitions": {
"AvailableServiceAlias": {
"properties": {
"name": {
"type": "string",
"description": "The name of the service alias."
},
"id": {
"type": "string",
"description": "The ID of the service alias."
},
"type": {
"type": "string",
"description": "The type of the resource."
},
"resourceName": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All fields beyond id, name, type should be inside a 'properties' envelope.

How is resourceName different than name? is there a more descriptive field name you could pick which is self describing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All fields beyond id, name, type should be inside a 'properties' envelope.

This isn't azure resource but service alias data. Not sure if that should adhere to resource's conventions of nesting properties.

How is resourceName different than name

Resource name is fully-qualified name like /services/Azure/ManagedInstance when name is just resource name without slashes (e.g. servicesAzureManagedInstance)

@avijitgupta should be able to provide more information

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not looking at the name or content of the request, only at the format. This is a Get request on a URL which should be an azure resource. When we do this, it should follow the convention of an azure resource.

"/services/Azure/ManagedInstance" isn't a azure resource name, so it will cause some confusion. Is there a different name we can call it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryansbenson
Below is the logic on the server.
this.Name = resourceName.Replace("/", string.Empty);
this.ResourceName = resourceName;
this.Id = string.Format("/subscriptions/{0}/resourceGroup/{1}/providers/Microsoft.Network/AvailableServiceAliases/{2}", subscriptionId, groupName, this.Name);
this.Type = "Microsoft.Network/AvailableServiceAliases";

Name is the azure resource name which does not have any '/' (it follows the ceonvention of azure resource)
ResourceName is another property which is the alias which the customer is expected to use. Don't expect it to cause confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryansbenson one extra thing - this API is already live so we can't change property names or object structure

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avijitgupta - With no change, when a user is told to "Use the resource name to ___", both could be valid interpretations. Why don't you call it "ResourceAlias"? Also, the Id should also include the /location/{location}/ part of the path (the ID should be Get-able).
@number213 - Your RP manifest doesn't have a route for locations/availableServiceAliases yet, so there can't be production traffic going to this path in your service. These reviews are in place to force consistency and catch issues like this before they go live.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is precedence set with other network APIs with properties outside of the properties body. Though this isn't compliant and will cause issues across ARM tooling, this is understood by the network team.
With regard to resourceName being confusing - it was agreed that a new name, something like 'alias' or 'resourceAlias', should be used but will be changed in a future API version.

"type": "string",
"description": "The resource name of the service alias."
}
},
"description": "The available service alias."
},
"AvailableServiceAliasesResult": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/AvailableServiceAlias"
},
"description": "An array of available service aliases."
},
"nextLink": {
"readOnly": true,
"type": "string",
"description": "The URL to get the next set of results."
}
},
"description": "An array of available service aliases."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parameters": {
"api-version": "2019-08-01",
"location": "westcentralus",
"subscriptionId": "subId"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "servicesAzure",
"id": "/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure",
"type": "Microsoft.Network/AvailableServiceAliases",
"resourceName": "/services/Azure"
},
{
"name": "servicesAzureManagedInstance",
"id": "/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance",
"type": "Microsoft.Network/AvailableServiceAliases",
"resourceName": "/services/Azure/ManagedInstance"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"parameters": {
"api-version": "2019-08-01",
"location": "westcentralus",
"subscriptionId": "subId",
"resourceGroupName": "rg1"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": "servicesAzure",
"id": "/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzure",
"type": "Microsoft.Network/AvailableServiceAliases",
"resourceName": "/services/Azure"
},
{
"name": "servicesAzureManagedInstance",
"id": "/subscriptions/subId/providers/Microsoft.Network/AvailableServiceAliases/servicesAzureManagedInstance",
"type": "Microsoft.Network/AvailableServiceAliases",
"resourceName": "/services/Azure/ManagedInstance"
}
]
}
}
}
}
1 change: 1 addition & 0 deletions specification/network/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ input-file:
- Microsoft.Network/stable/2019-08-01/applicationGateway.json
- Microsoft.Network/stable/2019-08-01/applicationSecurityGroup.json
- Microsoft.Network/stable/2019-08-01/availableDelegations.json
- Microsoft.Network/stable/2019-08-01/availableServiceAliases.json
- Microsoft.Network/stable/2019-08-01/azureFirewall.json
- Microsoft.Network/stable/2019-08-01/azureFirewallFqdnTag.json
- Microsoft.Network/stable/2019-08-01/bastionHost.json
Expand Down