Skip to content

Commit

Permalink
Adding Swagger for POST APIs used to upload a customer TDE certificat…
Browse files Browse the repository at this point in the history
…es (#3248)

* Adding Swagger for POST APIs used to upload a customer TDE certificate in CMS

* Addressing Jared's comment on PR
- Remove certificateName property
- Remove Resource and ProxyResource manually
- Edit TdeCertificate to reference "../../../common/v1/types.json#/definitions/ProxyResource"

* Addressing validation example errors

* Addressing validation example errors

* Adding to all package-composite-v* and package-pure of appropriate version
  • Loading branch information
nivimsft authored and marstr committed Jun 21, 2018
1 parent a2b654d commit 3c5a260
Show file tree
Hide file tree
Showing 5 changed files with 461 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"swagger": "2.0",
"info": {
"version": "2017-10-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/managedInstances/{managedInstanceName}/tdeCertificates": {
"post": {
"tags": [
"ManagedInstanceTdeCertificates"
],
"description": "Creates a TDE certificate for a given server.",
"operationId": "ManagedInstanceTdeCertificates_Create",
"parameters": [
{
"$ref": "#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/ManagedInstanceNameParameter"
},
{
"name": "parameters",
"in": "body",
"description": "The requested TDE certificate to be created or updated.",
"required": true,
"schema": {
"$ref": "#/definitions/TdeCertificate"
}
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully created the TDE certificate."
},
"default": {
"description": "*** Error Responses: ***\n\n * 400 MissingPrivateBlob - The private blob is missing.\n\n * 400 InvalidPrivateBlobOrPassword - Invalid private blob or password specified.\n\n * 400 InvalidResourceRequestBody - The resource or resource properties in the request body is empty or invalid.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found."
},
"202": {
"description": "Accepted"
}
},
"x-ms-long-running-operation": true,
"x-ms-examples": {
"Upload a TDE certificate": {
"$ref": "./examples/ManagedInstanceTdeCertificate.json"
}
}
}
}
},
"definitions": {
"TdeCertificateProperties": {
"description": "Properties of a TDE certificate.",
"required": [
"privateBlob"
],
"type": "object",
"properties": {
"privateBlob": {
"description": "The base64 encoded certificate private blob.",
"type": "string",
"x-ms-mutability": [
"create",
"update"
]
},
"certPassword": {
"description": "The certificate password.",
"type": "string",
"x-ms-mutability": [
"create",
"update"
]
}
}
},
"TdeCertificate": {
"description": "A TDE certificate that can be uploaded into a server.",
"type": "object",
"allOf": [
{
"$ref": "../../../common/v1/types.json#/definitions/ProxyResource"
}
],
"properties": {
"properties": {
"$ref": "#/definitions/TdeCertificateProperties",
"description": "Resource properties.",
"x-ms-client-flatten": 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"
}
}
}
}
Loading

0 comments on commit 3c5a260

Please sign in to comment.