diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/AzureADAdministrator.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/AzureADAdministrator.json new file mode 100644 index 000000000000..c3d312ea8579 --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/AzureADAdministrator.json @@ -0,0 +1,349 @@ +{ + "swagger": "2.0", + "info": { + "title": "MySQLManagementClient", + "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules and configurations.", + "version": "2021-12-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators/{administratorName}": { + "put": { + "tags": [ + "AzureADAdministrators" + ], + "operationId": "AzureADAdministrators_CreateOrUpdate", + "x-ms-examples": { + "Create an azure ad administrator": { + "$ref": "./examples/AzureADAdministratorCreate.json" + } + }, + "description": "Creates or updates an existing Azure Active Directory administrator.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/AdministratorNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AzureADAdministrator" + }, + "description": "The required parameters for creating or updating an aad administrator." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AzureADAdministrator" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/AzureADAdministrator" + } + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "AzureADAdministrators" + ], + "operationId": "AzureADAdministrators_Delete", + "x-ms-examples": { + "Delete an azure ad administrator": { + "$ref": "./examples/AzureADAdministratorDelete.json" + } + }, + "description": "Deletes an Azure AD Administrator.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/AdministratorNameParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "NoContent" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + } + }, + "get": { + "tags": [ + "AzureADAdministrators" + ], + "operationId": "AzureADAdministrators_Get", + "x-ms-examples": { + "Get an azure ad administrator": { + "$ref": "./examples/AzureADAdministratorGet.json" + } + }, + "description": "Gets information about an azure ad administrator.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/AdministratorNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AzureADAdministrator" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}/administrators": { + "get": { + "tags": [ + "AzureADAdministrators" + ], + "operationId": "AzureADAdministrators_ListByServer", + "x-ms-examples": { + "List Azure AD administrators in a server": { + "$ref": "./examples/AzureADAdministratorsListByServer.json" + } + }, + "description": "List all the AAD administrators in a given server.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AdministratorListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "AdministratorProperties": { + "type": "object", + "properties": { + "administratorType": { + "type": "string", + "description": "Type of the sever administrator.", + "enum": [ + "ActiveDirectory" + ], + "x-ms-enum": { + "name": "AdministratorType", + "modelAsString": true + } + }, + "login": { + "type": "string", + "description": "Login name of the server administrator." + }, + "sid": { + "type": "string", + "description": "SID (object ID) of the server administrator." + }, + "tenantId": { + "type": "string", + "description": "Tenant ID of the administrator." + }, + "identityResourceId": { + "type": "string", + "description": "The resource id of the identity used for AAD Authentication." + } + }, + "description": "The properties of an administrator." + }, + "AzureADAdministrator": { + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/AdministratorProperties", + "x-ms-client-flatten": true, + "description": "The properties of an administrator." + }, + "systemData": { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData", + "readOnly": true, + "description": "The system metadata relating to this resource." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a Administrator." + }, + "AdministratorListResult": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/AzureADAdministrator" + }, + "description": "The list of azure ad administrator of a server" + }, + "nextLink": { + "description": "The link used to get the next page of operations.", + "type": "string" + } + }, + "description": "A List of azure ad administrators." + }, + "CloudError": { + "type": "object", + "x-ms-external": true, + "properties": { + "error": { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse", + "description": "The resource management error response." + } + }, + "description": "An error response from the Batch service." + } + }, + "parameters": { + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server.", + "x-ms-parameter-location": "method" + }, + "AdministratorNameParameter": { + "name": "administratorName", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "ActiveDirectory" + ], + "x-ms-enum": { + "name": "AdministratorName", + "modelAsString": true + }, + "description": "The name of the Azure AD Administrator.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json new file mode 100644 index 000000000000..58765bbf1eae --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "resourceGroupName": "testrg", + "serverName": "mysqltestsvc4", + "administratorName": "ActiveDirectory", + "api-version": "2021-12-01-preview", + "parameters": { + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", + "tenantId": "c12b7025-bfe2-46c1-b463-993b5e4cd467", + "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory", + "name": "ActiveDirectory", + "type": "Microsoft.DBforMySQL/flexibleServers/administrators", + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", + "tenantId": "c12b7025-bfe2-46c1-b463-993b5e4cd467", + "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" + } + } + }, + "201": { + "body": { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory", + "name": "ActiveDirectory", + "type": "Microsoft.DBforMySQL/flexibleServers/administrators", + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", + "tenantId": "c12b7025-bfe2-46c1-b463-993b5e4cd467", + "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" + } + } + }, + "202": {} + } +} diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json new file mode 100644 index 000000000000..98de922c6a11 --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorDelete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "resourceGroupName": "testrg", + "serverName": "mysqltestsvc4", + "administratorName": "ActiveDirectory", + "api-version": "2021-12-01-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json new file mode 100644 index 000000000000..2aed501b1404 --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorGet.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "resourceGroupName": "testrg", + "serverName": "mysqltestsvc4", + "administratorName": "ActiveDirectory", + "api-version": "2021-12-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory", + "name": "ActiveDirectory", + "type": "Microsoft.DBforMySQL/flexibleServers/administrators", + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", + "tenantId": "c12b7025-bfe2-46c1-b463-993b5e4cd467", + "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" + } + } + } + } +} diff --git a/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json new file mode 100644 index 000000000000..55ad81d81d36 --- /dev/null +++ b/specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorsListByServer.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff", + "resourceGroupName": "testrg", + "serverName": "mysqltestsvc4", + "api-version": "2021-12-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforMySQL/flexibleServers/mysqltestsvc4/administrators/ActiveDirectory", + "name": "ActiveDirectory", + "type": "Microsoft.DBforMySQL/flexibleServers/administrators", + "properties": { + "administratorType": "ActiveDirectory", + "login": "bob@contoso.com", + "sid": "c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c", + "tenantId": "c12b7025-bfe2-46c1-b463-993b5e4cd467", + "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/test-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi" + } + } + ] + } + } + } +} diff --git a/specification/mysql/resource-manager/readme.md b/specification/mysql/resource-manager/readme.md index 21bdfc0c3956..0444a0b8729c 100644 --- a/specification/mysql/resource-manager/readme.md +++ b/specification/mysql/resource-manager/readme.md @@ -157,6 +157,7 @@ input-file: - Microsoft.DBforMySQL/preview/2021-12-01-preview/FlexibleServers.json - Microsoft.DBforMySQL/preview/2021-12-01-preview/LogFiles.json - Microsoft.DBforMySQL/preview/2021-12-01-preview/ServiceOperations.json +- Microsoft.DBforMySQL/preview/2021-12-01-preview/AzureADAdministrator.json ``` ## Suppression