-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flexible MySQL: add APIs for AAD administrator (#19949)
* Flexible MySQL server: add APIs for AAD administrator * Fix LintDiff error * Fix LintDiff check
- Loading branch information
Showing
6 changed files
with
466 additions
and
0 deletions.
There are no files selected for viewing
349 changes: 349 additions & 0 deletions
349
...esource-manager/Microsoft.DBforMySQL/preview/2021-12-01-preview/AzureADAdministrator.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
.../Microsoft.DBforMySQL/preview/2021-12-01-preview/examples/AzureADAdministratorCreate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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": "[email protected]", | ||
"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": "[email protected]", | ||
"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": "[email protected]", | ||
"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": {} | ||
} | ||
} |
Oops, something went wrong.