-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Adding swagger for endpoint certificates #17156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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": { | ||
| "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.", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "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": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use common types definitions for this and ProxyResource definition below. Not blocking from ARM perspective, but definitely a good idea.