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,296 @@
{
"swagger": "2.0",
"info": {
"version": "2021-11-01",
"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/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}": {
"get": {
"tags": [
"EndpointCertificates"
],
"description": "Gets a certificate used on the endpoint with the given id.",
"operationId": "EndpointCertificates_Get",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"name": "endpointType",
"in": "path",
"description": "Type of the endpoint whose certificate the customer is looking for.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved an endpoint certificate.",
"schema": {
"$ref": "#/definitions/EndpointCertificate"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription."
}
},
"x-ms-examples": {
"Gets an endpoint certificate.": {
"$ref": "./examples/EndpointCertificatesGet.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates": {
"get": {
"tags": [
"EndpointCertificates"
],
"description": "List certificates used on endpoints on the target instance.",
"operationId": "EndpointCertificates_ListByInstance",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved a list of endpoint certificates.",
"schema": {
"$ref": "#/definitions/EndpointCertificateListResult"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription."
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"Get a list of endpoint certificates.": {
"$ref": "./examples/EndpointCertificatesListByInstance.json"
}
}
}
}
},
"definitions": {
"EndpointCertificateProperties": {
"description": "The properties of an endpoint certificate.",
"type": "object",
"properties": {
"publicBlob": {
"description": "The certificate public blob",
"type": "string"
}
}
},
"Resource": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Resource

Better to use common types definitions for this and ProxyResource definition below. Not blocking from ARM perspective, but definitely a good idea.

"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": {}
},
"EndpointCertificate": {
"description": "Certificate used on an endpoint on the Managed Instance.",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/EndpointCertificateProperties",
"description": "Resource properties.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Resource properties

More specific description would be good.

"x-ms-client-flatten": true
}
}
},
"EndpointCertificateListResult": {
"description": "A list of endpoint certificates on the target instance.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/EndpointCertificate"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
}
},
"parameters": {
Copy link
Copy Markdown
Member

@mentat9 mentat9 Jan 26, 2022

Choose a reason for hiding this comment

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

parameters

Most of these are unused and should be removed. Of the ones that are used, SubscriptionIdParameter, ApiVersionParameter, ResourceGroupParameter have counterparts in common types. Recommend using those instead. If you do that and remove the unused ones, the only parameter you need here is ManagedInstanceNameParameter. #Resolved

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@mentat9 All of those that you are suggesting we should change are automatically generated from some of our sql pipelines. There are bunch of files like this that are already checked in. This has to look like this. It probably is not the best, but that is due to it being autogenerated. So, please, I would like it checked in this way as I can not change it.

"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"
},
"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"
},
"WorkspaceNameParameter": {
"name": "workspaceName",
"in": "path",
"description": "The name of the workspace.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlPoolNameParameter": {
"name": "sqlPoolName",
"in": "path",
"description": "The name of the sql pool.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"SqlDatabaseNameParameter": {
"name": "sqlDatabaseName",
"in": "path",
"description": "The name of the sql database.",
"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,21 @@
{
"parameters": {
"subscriptionId": "38e0dc56-907f-45ba-a97c-74233baad471",
"resourceGroupName": "testrg",
"managedInstanceName": "testcl",
"endpointType": "DATABASE_MIRRORING",
"api-version": "2021-11-01"
},
"responses": {
"200": {
"body": {
"properties": {
"publicBlob": "0x308203B23082021AA003020102021034C597BA"
},
"id": "/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/endpointCertificates/DATABASE_MIRRORING",
"name": "DATABASE_MIRRORING",
"type": "Microsoft.Sql/managedInstances/endpointCertificates"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parameters": {
"subscriptionId": "38e0dc56-907f-45ba-a97c-74233baad471",
"resourceGroupName": "testrg",
"managedInstanceName": "testcl",
"api-version": "2021-11-01"
},
"responses": {
"200": {
"body": {
"value": [
{
"properties": {
"publicBlob": "0x308203B23082021AA003020102021034C597BA"
},
"id": "/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/endpointCertificates/SERVICE_BROKER",
"name": "SERVICE_BROKER",
"type": "Microsoft.Sql/managedInstances/endpointCertificates"
},
{
"properties": {
"publicBlob": "0x308203B23082021AA003020102021034C597BA"
},
"id": "/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/endpointCertificates/DATABASE_MIRRORING",
"name": "DATABASE_MIRRORING",
"type": "Microsoft.Sql/managedInstances/endpointCertificates"
}
]
}
}
}
}
1 change: 1 addition & 0 deletions specification/sql/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ input-file:
- Microsoft.Sql/preview/2021-11-01-preview/ElasticPoolOperations.json
- Microsoft.Sql/preview/2021-11-01-preview/ElasticPools.json
- Microsoft.Sql/preview/2021-11-01-preview/EncryptionProtectors.json
- Microsoft.Sql/preview/2021-11-01-preview/EndpointCertificates.json
- Microsoft.Sql/preview/2021-11-01-preview/FailoverGroups.json
- Microsoft.Sql/preview/2021-11-01-preview/FirewallRules.json
- Microsoft.Sql/preview/2021-11-01-preview/IPv6FirewallRules.json
Expand Down