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,292 @@
{
"swagger": "2.0",
"info": {
"version": "2018-06-01-preview",
"title": "SqlManagementClient",
"description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities."
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources": {
"get": {
"tags": [
"PrivateLinkResources"
],
"description": "Gets the private link resources for SQL server.",
"operationId": "PrivateLinkResources_ListByServer",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved private link resources.",
"schema": {
"$ref": "#/definitions/PrivateLinkResourceListResult"
}
},
"default": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please start including the default response. @jaredmoo - any ETA when SQL can start including the default response where the schema complies with th ARM error contract schema?

"description": "*** Error Responses: ***\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation."
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"Gets private link resources for SQL.": {
"$ref": "./examples/PrivateLinkResourcesList.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how is a private link resource created?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how is the groupName parameter in the URL different from the groupId parameter in the body?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So this API doesn't map to any actual resource. This API is a utility to allow customers to be able to pass the proper "groupId" and "memberName" parameters to PUT PrivateEndpoint. Since groupId and memberName are different for each service, all implementing services have to implement this API. It is defined in section 6.4 in the NRP Spec.

Since SQL has only one groupId and member, we just return static values.

"get": {
"tags": [
"PrivateLinkResources"
],
"description": "Gets a private link resource for SQL server.",
"operationId": "PrivateLinkResources_Get",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ServerNameParameter"
},
{
"name": "groupName",
"in": "path",
"description": "The name of the private link resource.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved private link resources.",
"schema": {
"$ref": "#/definitions/PrivateLinkResource"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation."
}
},
"x-ms-examples": {
"Gets a private link resource for SQL.": {
"$ref": "./examples/PrivateLinkResourcesGet.json"
}
}
}
}
},
"definitions": {
"PrivateLinkResourceListResult": {
"description": "A list of private link resources",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/PrivateLinkResource"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
},
"PrivateLinkResourceProperties": {
"description": "Properties of a private link resource.",
"type": "object",
"properties": {
"groupId": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this resource group id as indicated in the description or something else? from the example, it doesnt seem like this is the resource group id.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GroupId is not related to Resource Groups in any way. GroupId represents different endpoints that a service can be accessed. Azure Networking's PrivateLink feature is being implemented by many services and during creation of PrivateLink you need to specify which "group" or endpoint you want to create the link against. For example, CosmosDB has an endpoint for MongoDB and an endpoint for Cassandra. Thus there are two "groups" that can be chosen. This API is a utility API that lists them.

SQL is a bit trivial because we only have one endpoint and thus one group.

"description": "The private link resource group id.",
"type": "string",
"readOnly": true
},
"requiredMembers": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what are some examples of members?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Members are sub sections of groups. I am not completely positive how they work honestly because SQL only has one group and one member: "sqlServer"

"description": "The private link resource required member names.",
"type": "array",
"items": {
"type": "string"
},
"readOnly": true
}
}
},
"Resource": {
"description": "ARM resource.",
"type": "object",
"properties": {
"id": {
"description": "Resource ID.",
"type": "string",
"readOnly": true
},
"name": {
"description": "Resource name.",
"type": "string",
"readOnly": true
},
"type": {
"description": "Resource type.",
"type": "string",
"readOnly": true
}
},
"x-ms-azure-resource": true
},
"ProxyResource": {
"description": "ARM proxy resource.",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"properties": {}
},
"PrivateLinkResource": {
"description": "A private link resource",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/PrivateLinkResourceProperties",
"description": "The private link resource group id.",
"readOnly": true
}
}
}
},
"parameters": {
"SubscriptionIdParameter": {
"name": "subscriptionId",
"in": "path",
"description": "The subscription ID that identifies an Azure subscription.",
"required": true,
"type": "string",
"x-ms-parameter-location": "client"
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"description": "The API version to use for the request.",
"required": true,
"type": "string",
"x-ms-parameter-location": "client"
},
"ResourceGroupParameter": {
"name": "resourceGroupName",
"in": "path",
"description": "The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"ServerNameParameter": {
"name": "serverName",
"in": "path",
"description": "The name of the server.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"ManagedInstanceNameParameter": {
"name": "managedInstanceName",
"in": "path",
"description": "The name of the managed instance.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"DatabaseNameParameter": {
"name": "databaseName",
"in": "path",
"description": "The name of the database.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"BlobAuditingPolicyNameParameter": {
"name": "blobAuditingPolicyName",
"in": "path",
"description": "The name of the blob auditing policy.",
"required": true,
"type": "string",
"enum": [
"default"
],
"x-ms-parameter-location": "method"
},
"SqlVirtualMachineInstanceNameParameter": {
"name": "sqlVirtualMachineInstanceName",
"in": "path",
"description": "The name of the SqlVirtualMachineInstance.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlVirtualMachineContainerNameParameter": {
"name": "sqlVirtualMachineContainerName",
"in": "path",
"description": "The name of the SqlVirtualMachineContainer.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"VirtualClusterNameParameter": {
"name": "virtualClusterName",
"in": "path",
"description": "The name of the virtual cluster.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
}
},
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"description": "Azure Active Directory OAuth2 Flow",
"flow": "implicit",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "Default",
"serverName": "test-svr",
"groupName" : "plr",
"api-version": "2018-06-01-preview"
},
"responses": {
"200": {
"body": {
"id": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateLinkResources/plr",
"name": "plr",
"type": "Microsoft.Sql/servers/privateLinkResources",
"properties": {
"groupId": "sqlServer",
"requiredMembers": [
"sqlServer"
]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "Default",
"serverName": "test-svr",
"api-version": "2018-06-01-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/test-svr/privateLinkResources/plr",
"name": "plr",
"type": "Microsoft.Sql/servers/privateLinkResources",
"properties": {
"groupId": "sqlServer",
"requiredMembers": [
"sqlServer"
]
}
}
]
}
}
}
}
3 changes: 3 additions & 0 deletions specification/sql/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ input-file:
- Microsoft.Sql/preview/2018-06-01-preview/managedInstances.json
- Microsoft.Sql/preview/2018-06-01-preview/FailoverDatabases.json
- Microsoft.Sql/preview/2018-06-01-preview/FailoverElasticPools.json
- Microsoft.Sql/preview/2018-06-01-preview/PrivateLinkResources.json

# Needed when there is more than one input file
override-info:
Expand Down Expand Up @@ -214,6 +215,7 @@ input-file:
- Microsoft.Sql/preview/2018-06-01-preview/managedInstances.json
- Microsoft.Sql/preview/2018-06-01-preview/FailoverDatabases.json
- Microsoft.Sql/preview/2018-06-01-preview/FailoverElasticPools.json
- Microsoft.Sql/preview/2018-06-01-preview/PrivateLinkResources.json

# Needed when there is more than one input file
override-info:
Expand Down Expand Up @@ -300,6 +302,7 @@ input-file:
- Microsoft.Sql/preview/2018-06-01-preview/managedInstances.json
- Microsoft.Sql/preview/2018-06-01-preview/FailoverDatabases.json
- Microsoft.Sql/preview/2018-06-01-preview/FailoverElasticPools.json
- Microsoft.Sql/preview/2018-06-01-preview/PrivateLinkResources.json

# Needed when there is more than one input file
override-info:
Expand Down