-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Microsoft.Sql - adding Managed Instance AdvancedThreatProtection APIs #19089
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
Merged
raych1
merged 1 commit into
Azure:dev-sql-Microsoft.Sql-2022-02-01-preview
from
cohen-uriel-ms:cohen-uriel-ms/dev-sql-Microsoft.Sql-2022-02-01-preview
May 20, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
292 changes: 292 additions & 0 deletions
292
...osoft.Sql/preview/2022-02-01-preview/ManagedDatabaseAdvancedThreatProtectionSettings.json
This file contains hidden or 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,292 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "version": "2022-02-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}/databases/{databaseName}/advancedThreatProtectionSettings": { | ||
| "get": { | ||
| "tags": [ | ||
| "ManagedDatabaseAdvancedThreatProtectionSettings" | ||
| ], | ||
| "description": "Gets a list of managed database's Advanced Threat Protection states.", | ||
| "operationId": "ManagedDatabaseAdvancedThreatProtectionSettings_ListByDatabase", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ManagedInstanceNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/DatabaseNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "Successfully retrieved the managed database Advanced Threat Protection states.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ManagedDatabaseAdvancedThreatProtectionListResult" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "*** Error Responses: ***\n\n * 400 UpdateNotAllowedOnPausedDatabase - User attempted to perform an update on a paused database.\n\n * 400 AdvancedThreatProtectionInsufficientDiskSpace - Insufficient disk space to save the Advanced Threat Protection settings metadata in the database\n\n * 400 InvalidDatabaseAdvancedThreatProtectionCreateRequest - The create database Advanced Threat Protection request does not exist or has no properties object\n\n * 400 AdvancedThreatProtectionInvalidUserSuppliedParameter - An invalid parameter value was provided by the client\n\n * 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 409 DatabaseAdvancedThreatProtectionInProgress - Setting the database Advanced Threat Protection is already in progress\n\n * 409 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 500 GetDatabaseAdvancedThreatProtectionFailed - Failed to get Advanced Threat Protection settings" | ||
| } | ||
| }, | ||
| "x-ms-pageable": { | ||
| "nextLinkName": "nextLink" | ||
| }, | ||
| "x-ms-examples": { | ||
| "Get a list of the managed database's Advanced Threat Protection settings.": { | ||
| "$ref": "./examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}": { | ||
| "get": { | ||
| "tags": [ | ||
| "ManagedDatabaseAdvancedThreatProtectionSettings" | ||
| ], | ||
| "description": "Gets a managed database's Advanced Threat Protection state.", | ||
| "operationId": "ManagedDatabaseAdvancedThreatProtectionSettings_Get", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ManagedInstanceNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/DatabaseNameParameter" | ||
| }, | ||
| { | ||
| "name": "advancedThreatProtectionName", | ||
| "in": "path", | ||
| "description": "The name of the Advanced Threat Protection state.", | ||
| "required": true, | ||
| "type": "string", | ||
| "enum": [ | ||
| "Default" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "AdvancedThreatProtectionName", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "Successfully retrieved the managed database's Advanced Threat Protection state.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ManagedDatabaseAdvancedThreatProtection" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "*** Error Responses: ***\n\n * 400 UpdateNotAllowedOnPausedDatabase - User attempted to perform an update on a paused database.\n\n * 400 AdvancedThreatProtectionInsufficientDiskSpace - Insufficient disk space to save the Advanced Threat Protection settings metadata in the database\n\n * 400 InvalidDatabaseAdvancedThreatProtectionCreateRequest - The create database Advanced Threat Protection request does not exist or has no properties object\n\n * 400 AdvancedThreatProtectionInvalidUserSuppliedParameter - An invalid parameter value was provided by the client\n\n * 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 409 DatabaseAdvancedThreatProtectionInProgress - Setting the database Advanced Threat Protection is already in progress\n\n * 409 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 500 GetDatabaseAdvancedThreatProtectionFailed - Failed to get Advanced Threat Protection settings" | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Get a managed database's Advanced Threat Protection settings.": { | ||
| "$ref": "./examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json" | ||
| } | ||
| } | ||
| }, | ||
| "put": { | ||
| "tags": [ | ||
| "ManagedDatabaseAdvancedThreatProtectionSettings" | ||
| ], | ||
| "description": "Creates or updates a managed database's Advanced Threat Protection state.", | ||
| "operationId": "ManagedDatabaseAdvancedThreatProtectionSettings_CreateOrUpdate", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ManagedInstanceNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/DatabaseNameParameter" | ||
| }, | ||
| { | ||
| "name": "advancedThreatProtectionName", | ||
| "in": "path", | ||
| "description": "The name of the Advanced Threat Protection state.", | ||
| "required": true, | ||
| "type": "string", | ||
| "enum": [ | ||
| "Default" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "AdvancedThreatProtectionName", | ||
| "modelAsString": true | ||
| } | ||
| }, | ||
| { | ||
| "name": "parameters", | ||
| "in": "body", | ||
| "description": "The managed database Advanced Threat Protection state.", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/definitions/ManagedDatabaseAdvancedThreatProtection" | ||
| } | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "Successfully set the managed database Advanced Threat Protection state.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ManagedDatabaseAdvancedThreatProtection" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "*** Error Responses: ***\n\n * 400 UpdateNotAllowedOnPausedDatabase - User attempted to perform an update on a paused database.\n\n * 400 AdvancedThreatProtectionInsufficientDiskSpace - Insufficient disk space to save the Advanced Threat Protection settings metadata in the database\n\n * 400 InvalidDatabaseAdvancedThreatProtectionCreateRequest - The create database Advanced Threat Protection request does not exist or has no properties object\n\n * 400 AdvancedThreatProtectionInvalidUserSuppliedParameter - An invalid parameter value was provided by the client\n\n * 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 400 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 DatabaseDoesNotExist - User has specified a database name that does not exist on this server instance.\n\n * 404 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 409 DatabaseAdvancedThreatProtectionInProgress - Setting the database Advanced Threat Protection is already in progress\n\n * 409 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 500 DatabaseIsUnavailable - Loading failed. Please try again later.\n\n * 500 UpsertDatabaseAdvancedThreatProtectionFailed - An error has occurred while saving Advanced Threat Protection settings, please try again later\n\n * 500 GetDatabaseAdvancedThreatProtectionFailed - Failed to get Advanced Threat Protection settings" | ||
| }, | ||
| "201": { | ||
| "description": "Successfully created the managed database Advanced Threat Protection state.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ManagedDatabaseAdvancedThreatProtection" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Update a managed database's Advanced Threat Protection settings with minimal parameters": { | ||
| "$ref": "./examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json" | ||
| }, | ||
| "Update a managed database's Advanced Threat Protection settings with all parameters": { | ||
| "$ref": "./examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "AdvancedThreatProtectionProperties": { | ||
| "description": "Properties of an Advanced Threat Protection state.", | ||
| "required": [ | ||
| "state" | ||
| ], | ||
| "type": "object", | ||
| "properties": { | ||
| "state": { | ||
| "description": "Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a state has not been applied yet on the specific database or server.", | ||
| "enum": [ | ||
| "New", | ||
| "Enabled", | ||
| "Disabled" | ||
| ], | ||
| "type": "string", | ||
| "x-ms-enum": { | ||
| "name": "AdvancedThreatProtectionState", | ||
| "modelAsString": false | ||
| } | ||
| }, | ||
| "creationTime": { | ||
| "format": "date-time", | ||
| "description": "Specifies the UTC creation time of the policy.", | ||
| "type": "string", | ||
| "readOnly": true | ||
| } | ||
| } | ||
| }, | ||
| "ManagedDatabaseAdvancedThreatProtection": { | ||
| "description": "A managed database Advanced Threat Protection.", | ||
| "type": "object", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/definitions/ProxyResource" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "systemData": { | ||
| "$ref": "../../../common/v1/types.json#/definitions/systemData", | ||
| "description": "SystemData of AdvancedThreatProtectionResource.", | ||
| "readOnly": true | ||
| }, | ||
| "properties": { | ||
| "$ref": "#/definitions/AdvancedThreatProtectionProperties", | ||
| "description": "Resource properties.", | ||
| "x-ms-client-flatten": true | ||
| } | ||
| } | ||
| }, | ||
| "ManagedDatabaseAdvancedThreatProtectionListResult": { | ||
| "description": "A list of the managed database's Advanced Threat Protection settings.", | ||
| "type": "object", | ||
| "properties": { | ||
| "value": { | ||
| "description": "Array of results.", | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/ManagedDatabaseAdvancedThreatProtection" | ||
| }, | ||
| "readOnly": true | ||
| }, | ||
| "nextLink": { | ||
| "description": "Link to retrieve next page of results.", | ||
| "type": "string", | ||
| "readOnly": true | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "parameters": { | ||
| "DatabaseNameParameter": { | ||
| "name": "databaseName", | ||
| "in": "path", | ||
| "description": "The name of the database.", | ||
| "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" | ||
| } | ||
| }, | ||
| "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" | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If a user can create a resource, a user should be able to delete the resource, please read our Inconsistent or Incomplete CRUD documentation: https://armwiki.azurewebsites.net/rp_onboarding/process/api_review_best_practices.html#common-issues-found-in-review
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.
This is not a resource, these are settings set for a Managed Instance Database. It doesn't make sense to have a DELETE operation for it. It can be either Enabled or Disabled. That's it.
Note that this same operations (APIs) have been added for other SQL resource (regular Servers and Databases, and this adds the same for Managed Instance Servers and Databases). They have already been reviewed by ARM Review, approved and already released as part of 2021-11-01-preview.