-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Microsoft.Sql - adding Database and Server AdvancedThreatProtection APIs #17881
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 6 commits into
Azure:dev-sql-Microsoft.Sql-2021-11-01-preview
from
cohen-uriel-ms:cohen-uriel-ms/SwaggerSqlAdvancedThreatProtection
Feb 24, 2022
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5826e1e
Microsoft.Sql - adding Database and Server AdvancedThreatProtection APIs
cohen-uriel-ms 8f9014e
Fix to Swagger ModelValidation failures
cohen-uriel-ms bb3ed54
Removing the 201 from Database Upsert operation since it is not a lon…
cohen-uriel-ms eff0ac8
Change the name of the API to AdvancedThreatProtectionSettings
cohen-uriel-ms e63ef4e
Fix to the renaming to AdvancedThreatProtectionSettings
cohen-uriel-ms c8f1c1c
Remove old files
cohen-uriel-ms 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
...ce-manager/Microsoft.Sql/preview/2021-11-01-preview/DatabaseAdvancedThreatProtection.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": "2021-11-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/servers/{serverName}/databases/{databaseName}/advancedThreatProtection": { | ||
| "get": { | ||
| "tags": [ | ||
| "DatabaseAdvancedThreatProtection" | ||
| ], | ||
| "description": "Gets a list of database's Advanced Threat Protection states.", | ||
| "operationId": "DatabaseAdvancedThreatProtection_ListByDatabase", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ServerNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/DatabaseNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "Successfully retrieved the database Advanced Threat Protection states.", | ||
| "schema": { | ||
| "$ref": "#/definitions/DatabaseAdvancedThreatProtectionListResult" | ||
| } | ||
| }, | ||
| "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 state 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": { | ||
| "Lists the database's Advanced Threat Protection states.": { | ||
| "$ref": "./examples/DatabaseAdvancedThreatProtectionListByDatabase.json" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtection/{advancedThreatProtectionName}": { | ||
|
cohen-uriel-ms marked this conversation as resolved.
Outdated
|
||
| "get": { | ||
| "tags": [ | ||
| "DatabaseAdvancedThreatProtection" | ||
| ], | ||
| "description": "Gets a database's Advanced Threat Protection state.", | ||
| "operationId": "DatabaseAdvancedThreatProtection_Get", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ServerNameParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/DatabaseNameParameter" | ||
| }, | ||
| { | ||
| "name": "advancedThreatProtectionName", | ||
| "in": "path", | ||
| "description": "The name of the Advanced Threat Protection state.", | ||
| "required": true, | ||
| "type": "string", | ||
| "enum": [ | ||
| "Default" | ||
|
cohen-uriel-ms marked this conversation as resolved.
|
||
| ], | ||
| "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 database's Advanced Threat Protection state.", | ||
| "schema": { | ||
| "$ref": "#/definitions/DatabaseAdvancedThreatProtection" | ||
| } | ||
| }, | ||
| "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 state 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 database's Advanced Threat Protection state.": { | ||
| "$ref": "./examples/DatabaseAdvancedThreatProtectionGet.json" | ||
| } | ||
| } | ||
| }, | ||
| "put": { | ||
| "tags": [ | ||
| "DatabaseAdvancedThreatProtection" | ||
| ], | ||
| "description": "Creates or updates a database's Advanced Threat Protection state.", | ||
| "operationId": "DatabaseAdvancedThreatProtection_CreateOrUpdate", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ServerNameParameter" | ||
| }, | ||
| { | ||
| "$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 database Advanced Threat Protection state.", | ||
| "required": true, | ||
| "schema": { | ||
| "$ref": "#/definitions/DatabaseAdvancedThreatProtection" | ||
| } | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter" | ||
| }, | ||
| { | ||
| "$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "Successfully set the database Advanced Threat Protection state.", | ||
| "schema": { | ||
| "$ref": "#/definitions/DatabaseAdvancedThreatProtection" | ||
| } | ||
| }, | ||
| "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 state 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": { | ||
|
cohen-uriel-ms marked this conversation as resolved.
|
||
| "description": "Successfully created the database Advanced Threat Protection state.", | ||
| "schema": { | ||
| "$ref": "#/definitions/DatabaseAdvancedThreatProtection" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Update a database's Advanced Threat Protection state with minimal parameters": { | ||
| "$ref": "./examples/DatabaseAdvancedThreatProtectionCreateMin.json" | ||
| }, | ||
| "Update a database's Advanced Threat Protection state with all parameters": { | ||
| "$ref": "./examples/DatabaseAdvancedThreatProtectionCreateMax.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "AdvancedThreatProtectionProperties": { | ||
| "description": "Properties of an Advanced Threat Protection state.", | ||
| "required": [ | ||
| "state" | ||
| ], | ||
| "type": "object", | ||
| "properties": { | ||
| "state": { | ||
|
cohen-uriel-ms marked this conversation as resolved.
|
||
| "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 | ||
| } | ||
| } | ||
| }, | ||
| "DatabaseAdvancedThreatProtection": { | ||
| "description": "A 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 | ||
| } | ||
| } | ||
| }, | ||
| "DatabaseAdvancedThreatProtectionListResult": { | ||
| "description": "A list of the database's Advanced Threat Protection configurations.", | ||
| "type": "object", | ||
| "properties": { | ||
| "value": { | ||
| "description": "Array of results.", | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/DatabaseAdvancedThreatProtection" | ||
| }, | ||
| "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" | ||
| }, | ||
| "ServerNameParameter": { | ||
| "name": "serverName", | ||
| "in": "path", | ||
| "description": "The name of the server.", | ||
| "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.
Uh oh!
There was an error while loading. Please reload this page.