diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index aa4ba4a726..143f7e3d12 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -2928,6 +2928,39 @@ export interface ServerDnsAliasAcquisition { oldServerDnsAliasId?: string; } +/** + * @class + * Initializes a new instance of the ServerSecurityAlertPolicy class. + * @constructor + * A server security alert policy. + * + * @member {string} state Specifies the state of the policy, whether it is + * enabled or disabled. Possible values include: 'New', 'Enabled', 'Disabled' + * @member {array} [disabledAlerts] Specifies an array of alerts that are + * disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, + * Access_Anomaly + * @member {array} [emailAddresses] Specifies an array of e-mail addresses to + * which the alert is sent. + * @member {boolean} [emailAccountAdmins] Specifies that the alert is sent to + * the account administrators. + * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all + * Threat Detection audit logs. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the Threat Detection audit storage account. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * Threat Detection audit logs. + */ +export interface ServerSecurityAlertPolicy extends ProxyResource { + state: string; + disabledAlerts?: string[]; + emailAddresses?: string[]; + emailAccountAdmins?: boolean; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; +} + /** * @class * Initializes a new instance of the RestorePoint class. diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index f084ef991a..a0afe6acc5 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -119,6 +119,7 @@ exports.AutomaticTuningServerOptions = require('./automaticTuningServerOptions') exports.ServerAutomaticTuning = require('./serverAutomaticTuning'); exports.ServerDnsAlias = require('./serverDnsAlias'); exports.ServerDnsAliasAcquisition = require('./serverDnsAliasAcquisition'); +exports.ServerSecurityAlertPolicy = require('./serverSecurityAlertPolicy'); exports.RestorePoint = require('./restorePoint'); exports.CreateDatabaseRestorePointDefinition = require('./createDatabaseRestorePointDefinition'); exports.DatabaseOperation = require('./databaseOperation'); diff --git a/lib/services/sqlManagement2/lib/models/serverSecurityAlertPolicy.js b/lib/services/sqlManagement2/lib/models/serverSecurityAlertPolicy.js index bbe37cd620..4d2415060c 100644 --- a/lib/services/sqlManagement2/lib/models/serverSecurityAlertPolicy.js +++ b/lib/services/sqlManagement2/lib/models/serverSecurityAlertPolicy.js @@ -21,7 +21,7 @@ class ServerSecurityAlertPolicy extends models['ProxyResource'] { /** * Create a ServerSecurityAlertPolicy. * @member {string} state Specifies the state of the policy, whether it is - * enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * enabled or disabled. Possible values include: 'New', 'Enabled', 'Disabled' * @member {array} [disabledAlerts] Specifies an array of alerts that are * disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, * Access_Anomaly @@ -84,7 +84,7 @@ class ServerSecurityAlertPolicy extends models['ProxyResource'] { serializedName: 'properties.state', type: { name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] + allowedValues: [ 'New', 'Enabled', 'Disabled' ] } }, disabledAlerts: { diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index f81fd990d9..f1fef62398 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -25782,6 +25782,311 @@ export interface ServerDnsAliases { listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.ServerDnsAliasListResult>): void; } +/** + * @class + * ServerSecurityAlertPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerSecurityAlertPolicies { + + + /** + * Get a server's security alert policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse<ServerSecurityAlertPolicy>} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.ServerSecurityAlertPolicy>>; + + /** + * Get a server's security alert policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServerSecurityAlertPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServerSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServerSecurityAlertPolicy} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.ServerSecurityAlertPolicy>; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback<models.ServerSecurityAlertPolicy>): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.ServerSecurityAlertPolicy>): void; + + + /** + * Creates or updates a threat detection policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The server security alert policy. + * + * @param {string} parameters.state Specifies the state of the policy, whether + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that + * are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly + * + * @param {array} [parameters.emailAddresses] Specifies an array of e-mail + * addresses to which the alert is sent. + * + * @param {boolean} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse<ServerSecurityAlertPolicy>} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.ServerSecurityAlertPolicy>>; + + /** + * Creates or updates a threat detection policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The server security alert policy. + * + * @param {string} parameters.state Specifies the state of the policy, whether + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that + * are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly + * + * @param {array} [parameters.emailAddresses] Specifies an array of e-mail + * addresses to which the alert is sent. + * + * @param {boolean} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServerSecurityAlertPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServerSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServerSecurityAlertPolicy} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.ServerSecurityAlertPolicy>; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, callback: ServiceCallback<models.ServerSecurityAlertPolicy>): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.ServerSecurityAlertPolicy>): void; + + + /** + * Creates or updates a threat detection policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The server security alert policy. + * + * @param {string} parameters.state Specifies the state of the policy, whether + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that + * are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly + * + * @param {array} [parameters.emailAddresses] Specifies an array of e-mail + * addresses to which the alert is sent. + * + * @param {boolean} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse<ServerSecurityAlertPolicy>} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.ServerSecurityAlertPolicy>>; + + /** + * Creates or updates a threat detection policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The server security alert policy. + * + * @param {string} parameters.state Specifies the state of the policy, whether + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' + * + * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that + * are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly + * + * @param {array} [parameters.emailAddresses] Specifies an array of e-mail + * addresses to which the alert is sent. + * + * @param {boolean} [parameters.emailAccountAdmins] Specifies that the alert is + * sent to the account administrators. + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage + * will hold all Threat Detection audit logs. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the Threat Detection audit storage account. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the Threat Detection audit logs. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServerSecurityAlertPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServerSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServerSecurityAlertPolicy} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.ServerSecurityAlertPolicy>; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, callback: ServiceCallback<models.ServerSecurityAlertPolicy>): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.ServerSecurityAlertPolicy>): void; +} + /** * @class * RestorePoints diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 8e1af1c43d..15c3b3912e 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -68,6 +68,7 @@ exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPoli exports.ManagedDatabases = require('./managedDatabases'); exports.ServerAutomaticTuningOperations = require('./serverAutomaticTuningOperations'); exports.ServerDnsAliases = require('./serverDnsAliases'); +exports.ServerSecurityAlertPolicies = require('./serverSecurityAlertPolicies'); exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); diff --git a/lib/services/sqlManagement2/lib/operations/serverSecurityAlertPolicies.js b/lib/services/sqlManagement2/lib/operations/serverSecurityAlertPolicies.js index b3da4e50a6..8113085939 100644 --- a/lib/services/sqlManagement2/lib/operations/serverSecurityAlertPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/serverSecurityAlertPolicies.js @@ -175,7 +175,8 @@ function _get(resourceGroupName, serverName, options, callback) { * @param {object} parameters The server security alert policy. * * @param {string} parameters.state Specifies the state of the policy, whether - * it is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that * are disabled. Allowed values are: Sql_Injection, @@ -280,7 +281,8 @@ function _createOrUpdate(resourceGroupName, serverName, parameters, options, cal * @param {object} parameters The server security alert policy. * * @param {string} parameters.state Specifies the state of the policy, whether - * it is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that * are disabled. Allowed values are: Sql_Injection, @@ -574,7 +576,8 @@ class ServerSecurityAlertPolicies { * @param {object} parameters The server security alert policy. * * @param {string} parameters.state Specifies the state of the policy, whether - * it is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that * are disabled. Allowed values are: Sql_Injection, @@ -633,7 +636,8 @@ class ServerSecurityAlertPolicies { * @param {object} parameters The server security alert policy. * * @param {string} parameters.state Specifies the state of the policy, whether - * it is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that * are disabled. Allowed values are: Sql_Injection, @@ -715,7 +719,8 @@ class ServerSecurityAlertPolicies { * @param {object} parameters The server security alert policy. * * @param {string} parameters.state Specifies the state of the policy, whether - * it is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that * are disabled. Allowed values are: Sql_Injection, @@ -774,7 +779,8 @@ class ServerSecurityAlertPolicies { * @param {object} parameters The server security alert policy. * * @param {string} parameters.state Specifies the state of the policy, whether - * it is enabled or disabled. Possible values include: 'Enabled', 'Disabled' + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * * @param {array} [parameters.disabledAlerts] Specifies an array of alerts that * are disabled. Allowed values are: Sql_Injection, diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 2fc873b859..9bc8b10077 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -108,6 +108,7 @@ export default class SqlManagementClient extends AzureServiceClient { managedDatabases: operations.ManagedDatabases; serverAutomaticTuningOperations: operations.ServerAutomaticTuningOperations; serverDnsAliases: operations.ServerDnsAliases; + serverSecurityAlertPolicies: operations.ServerSecurityAlertPolicies; restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index 491ae83444..5bcff3d4c5 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -125,6 +125,7 @@ class SqlManagementClient extends ServiceClient { this.managedDatabases = new operations.ManagedDatabases(this); this.serverAutomaticTuningOperations = new operations.ServerAutomaticTuningOperations(this); this.serverDnsAliases = new operations.ServerDnsAliases(this); + this.serverSecurityAlertPolicies = new operations.ServerSecurityAlertPolicies(this); this.restorePoints = new operations.RestorePoints(this); this.databaseOperations = new operations.DatabaseOperations(this); this.elasticPoolOperations = new operations.ElasticPoolOperations(this);