Skip to content
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

[Do not merge]Dev/srmarkov/server trust certificatesv2 #15883

Closed
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,297 @@
{
"swagger": "2.0",
"info": {
"version": "2021-05-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}/serverTrustCertificates/{certificateName}": {
"get": {
"tags": [
"ServerTrustCertificates"
],
"description": "Gets a server trust certificate that was uploaded from box to Sql Managed Instance.",
"operationId": "ServerTrustCertificates_Get",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"name": "certificateName",
"in": "path",
"description": "Name of of the certificate to get.",
"required": true,
"type": "string"
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved a hybrid certificate.",
"schema": {
"$ref": "#/definitions/ServerTrustCertificate"
}
},
"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 server trust certificate.": {
"$ref": "./examples/ServerTrustCertificatesGet.json"
}
}
},
"put": {
"tags": [
"ServerTrustCertificates"
],
"description": "Uploads a server trust certificate from box to Sql Managed Instance.",
"operationId": "ServerTrustCertificates_CreateOrUpdate",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"name": "certificateName",
"in": "path",
"description": "Name of of the certificate to upload.",
"required": true,
"type": "string"
},
{
"name": "parameters",
"in": "body",
"description": "The server trust certificate info.",
"required": true,
"schema": {
"$ref": "#/definitions/ServerTrustCertificate"
}
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Certificate already existed.",
"schema": {
"$ref": "#/definitions/ServerTrustCertificate"
}
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 MissingPublicBlob - The public blob is missing.\n\n * 400 InvalidPublicBlob - Invalid public blob specified, reason: '{0}'.\n\n * 400 MissingCertificateName - The certificate name is missing.\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.\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."
},
"202": {
"description": "Accepted request for creating server trust certificate."
},
"201": {
"description": "Certificate is successfully created.",
"schema": {
"$ref": "#/definitions/ServerTrustCertificate"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"Create server trust certificate.": {
"$ref": "./examples/ServerTrustCertificatesCreate.json"
}
}
},
"delete": {
"tags": [
"ServerTrustCertificates"
],
"description": "Deletes a server trust certificate that was uploaded from box to Sql Managed Instance.",
"operationId": "ServerTrustCertificates_Delete",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"name": "certificateName",
"in": "path",
"description": "Name of of the certificate to delete.",
"required": true,
"type": "string"
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Certificate successfully deleted."
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 MissingCertificateName - The certificate name is missing.\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.\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."
},
"202": {
"description": "Accepted request for deleting server trust certificate."
},
"204": {
"description": "Certificate resource not found."
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"Delete server trust certificate.": {
"$ref": "./examples/ServerTrustCertificatesDelete.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates": {
"get": {
"tags": [
"ServerTrustCertificates"
],
"description": "Gets a list of server trust certificates that were uploaded from box to the given Sql Managed Instance.",
"operationId": "ServerTrustCertificates_ListByInstance",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved a list of server trust certificates.",
"schema": {
"$ref": "#/definitions/ServerTrustCertificatesListResult"
}
},
"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": {
"Gets a list of server trust certificates on a given server.": {
"$ref": "./examples/ServerTrustCertificatesListByInstance.json"
}
}
}
}
},
"definitions": {
"ServerTrustCertificateProperties": {
"description": "The properties of a server trust certificate.",
"type": "object",
"properties": {
"publicBlob": {
"description": "The certificate public blob",
"type": "string"
},
"thumbprint": {
"description": "The certificate thumbprint",
"type": "string",
"readOnly": true
},
"certificateName": {
"description": "The certificate name",
"type": "string",
"readOnly": true
}
}
},
"ServerTrustCertificate": {
"description": "Server trust certificate imported from box to enable connection between box and Sql Managed Instance.",
"type": "object",
"allOf": [
{
"$ref": "../../../common/v1/types.json#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/ServerTrustCertificateProperties",
"description": "Resource properties.",
"x-ms-client-flatten": true
}
}
},
"ServerTrustCertificatesListResult": {
"description": "A list of server trust certificates in instance.",
"type": "object",
"properties": {
"value": {
"description": "Array of results.",
"type": "array",
"items": {
"$ref": "#/definitions/ServerTrustCertificate"
},
"readOnly": true
},
"nextLink": {
"description": "Link to retrieve next page of results.",
"type": "string",
"readOnly": true
}
}
}
},
"parameters": {
"ManagedInstanceNameParameter": {
"name": "managedInstanceName",
"in": "path",
"description": "The name of the managed instance.",
"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,41 @@
{
"parameters": {
"subscriptionId": "0574222d-5c7f-489c-a172-b3013eafab53",
"resourceGroupName": "testrg",
"managedInstanceName": "testcl",
"certificateName": "someName",
"api-version": "2021-05-01-preview",
"parameters": {
"properties": {
"publicBlob": "308203AE30820296A0030201020210"
}
}
},
"responses": {
"200": {
"body": {
"properties": {
"publicBlob": "308203AE30820296A0030201020210",
"thumbprint": "33702D20EC86119985283",
"certificateName": "someName"
},
"id": "/subscriptions/0574222d-5c7f-489c-a172-b3013eafab53/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/serverTrustCertificates/someName",
"name": "someName",
"type": "Microsoft.Sql/managedInstances/serverTrustCertificates"
}
},
"201": {
"body": {
"properties": {
"publicBlob": "308203AE30820296A0030201020210",
"thumbprint": "33702D20EC86119985283",
"certificateName": "someName"
},
"id": "/subscriptions/0574222d-5c7f-489c-a172-b3013eafab53/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/serverTrustCertificates/someName",
"name": "someName",
"type": "Microsoft.Sql/managedInstances/serverTrustCertificates"
}
},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parameters": {
"subscriptionId": "38e0dc56-907f-45ba-a97c-74233baad471",
"resourceGroupName": "testrg",
"managedInstanceName": "testcl",
"certificateName": "someName",
"api-version": "2021-05-01-preview"
},
"responses": {
"200": {},
"204": {},
"202": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"parameters": {
"subscriptionId": "38e0dc56-907f-45ba-a97c-74233baad471",
"resourceGroupName": "testrg",
"managedInstanceName": "testcl",
"certificateName": "testCert",
"api-version": "2021-05-01-preview"
},
"responses": {
"200": {
"body": {
"properties": {
"publicBlob": "308203B23082021AA003020102021034C597BA",
"thumbprint": "57CFA9CF16F2FB2775AF059A95C6D5B897DA2C05",
"certificateName": "testCert"
},
"id": "/subscriptions/38e0dc56-907f-45ba-a97c-74233baad471/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testcl/serverTrustCertificates/testCert",
"name": "testCert",
"type": "Microsoft.Sql/managedInstances/serverTrustCertificates"
}
}
}
}
Loading