From 36e907da926a3d71da52633a876eb3ca79b2a0dc Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 21 Jun 2018 09:08:24 -0700 Subject: [PATCH] [AutoPR sql/resource-manager] Adding Swagger for POST APIs used to upload a customer TDE certificates (#3013) * Generated from e3529a46fd8d20ae6db5a542fe9762a365879439 Adding Swagger for POST APIs used to upload a customer TDE certificate in CMS * Generated from 9f0ba3d29675d6160b4cd881c52991fef58e0927 Addressing Jared's comment on PR - Remove certificateName property - Remove Resource and ProxyResource manually - Edit TdeCertificate to reference "../../../common/v1/types.json#/definitions/ProxyResource" * Generated from 8a72b9ba5c2b5c8621cd628c62702a0bd4933259 Adding to all package-composite-v* and package-pure of appropriate version --- .../lib/models/databaseBlobAuditingPolicy.js | 76 +- .../sqlManagement2/lib/models/index.d.ts | 519 +-- .../sqlManagement2/lib/models/index.js | 8 +- .../lib/models/tdeCertificate.js | 88 + .../backupShortTermRetentionPolicies.js | 462 --- .../databaseBlobAuditingPolicies.js | 250 +- ...aseVulnerabilityAssessmentRuleBaselines.js | 99 +- .../sqlManagement2/lib/operations/index.d.ts | 2806 +++-------------- .../sqlManagement2/lib/operations/index.js | 8 +- .../managedInstanceTdeCertificates.js | 466 +++ .../lib/operations/tdeCertificates.js | 466 +++ .../lib/sqlManagementClient.d.ts | 8 +- .../sqlManagement2/lib/sqlManagementClient.js | 8 +- 13 files changed, 1638 insertions(+), 3626 deletions(-) create mode 100644 lib/services/sqlManagement2/lib/models/tdeCertificate.js create mode 100644 lib/services/sqlManagement2/lib/operations/managedInstanceTdeCertificates.js create mode 100644 lib/services/sqlManagement2/lib/operations/tdeCertificates.js diff --git a/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js b/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js index f08cff6de8..37930527f8 100644 --- a/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js +++ b/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js @@ -32,82 +32,12 @@ class DatabaseBlobAuditingPolicy extends models['ProxyResource'] { * is required. * @member {number} [retentionDays] Specifies the number of days to keep in * the audit logs. - * @member {array} [auditActionsAndGroups] Specifies the Actions-Groups and - * Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific - * groups that cover your auditing needs. Using unnecessary groups could lead - * to very large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The - * supported actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a - * table, view, or stored procedure, or an entire database or schema. For the - * latter cases, the forms DATABASE:: and SCHEMA:: are - * used, respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + * @member {array} [auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage * subscription Id. * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. + * storageAccountAccessKey value is the storage’s secondary key. */ constructor() { super(); diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index 143f7e3d12..8eeadb3e7e 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -1064,6 +1064,42 @@ export interface DatabaseUsage { readonly nextResetTime?: Date; } +/** + * @class + * Initializes a new instance of the DatabaseBlobAuditingPolicy class. + * @constructor + * A database blob auditing policy. + * + * @member {string} [kind] Resource kind. + * @member {string} state Specifies the state of the policy. If state is + * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible + * values include: 'Enabled', 'Disabled' + * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, + * storageEndpoint is required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the auditing storage account. If state is Enabled, storageAccountAccessKey + * is required. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * audit logs. + * @member {array} [auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage + * subscription Id. + * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. + */ +export interface DatabaseBlobAuditingPolicy extends ProxyResource { + readonly kind?: string; + state: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + auditActionsAndGroups?: string[]; + storageAccountSubscriptionId?: string; + isStorageSecondaryKeyInUse?: boolean; +} + /** * @class * Initializes a new instance of the AutomaticTuningOptions class. @@ -1855,430 +1891,6 @@ export interface VirtualNetworkRule extends ProxyResource { readonly state?: string; } -/** - * @class - * Initializes a new instance of the ExtendedDatabaseBlobAuditingPolicy class. - * @constructor - * An extended database blob auditing policy. - * - * @member {string} [predicateExpression] Specifies condition of where clause - * when creating an audit. - * @member {string} state Specifies the state of the policy. If state is - * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). If state is Enabled, - * storageEndpoint is required. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the auditing storage account. If state is Enabled, storageAccountAccessKey - * is required. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * audit logs. - * @member {array} [auditActionsAndGroups] Specifies the Actions-Groups and - * Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage - * subscription Id. - * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - */ -export interface ExtendedDatabaseBlobAuditingPolicy extends ProxyResource { - predicateExpression?: string; - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; -} - -/** - * @class - * Initializes a new instance of the ExtendedServerBlobAuditingPolicy class. - * @constructor - * An extended server blob auditing policy. - * - * @member {string} [predicateExpression] Specifies condition of where clause - * when creating an audit. - * @member {string} state Specifies the state of the policy. If state is - * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). If state is Enabled, - * storageEndpoint is required. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the auditing storage account. If state is Enabled, storageAccountAccessKey - * is required. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * audit logs. - * @member {array} [auditActionsAndGroups] Specifies the Actions-Groups and - * Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage - * subscription Id. - * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - */ -export interface ExtendedServerBlobAuditingPolicy extends ProxyResource { - predicateExpression?: string; - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; -} - -/** - * @class - * Initializes a new instance of the ServerBlobAuditingPolicy class. - * @constructor - * A server blob auditing policy. - * - * @member {string} state Specifies the state of the policy. If state is - * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). If state is Enabled, - * storageEndpoint is required. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the auditing storage account. If state is Enabled, storageAccountAccessKey - * is required. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * audit logs. - * @member {array} [auditActionsAndGroups] Specifies the Actions-Groups and - * Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage - * subscription Id. - * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - */ -export interface ServerBlobAuditingPolicy extends ProxyResource { - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; -} - -/** - * @class - * Initializes a new instance of the DatabaseBlobAuditingPolicy class. - * @constructor - * A database blob auditing policy. - * - * @member {string} [kind] Resource kind. - * @member {string} state Specifies the state of the policy. If state is - * Enabled, storageEndpoint and storageAccountAccessKey are required. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). If state is Enabled, - * storageEndpoint is required. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the auditing storage account. If state is Enabled, storageAccountAccessKey - * is required. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * audit logs. - * @member {array} [auditActionsAndGroups] Specifies the Actions-Groups and - * Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage - * subscription Id. - * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - */ -export interface DatabaseBlobAuditingPolicy extends ProxyResource { - readonly kind?: string; - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; -} - /** * @class * Initializes a new instance of the DatabaseVulnerabilityAssessmentRuleBaselineItem class. @@ -2928,39 +2540,6 @@ 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. @@ -4123,6 +3702,20 @@ export interface BackupShortTermRetentionPolicy extends ProxyResource { retentionDays?: number; } +/** + * @class + * Initializes a new instance of the TdeCertificate class. + * @constructor + * A TDE certificate that can be uploaded into a server. + * + * @member {string} privateBlob The base64 encoded certificate private blob. + * @member {string} [certPassword] The certificate password. + */ +export interface TdeCertificate extends ProxyResource { + privateBlob: string; + certPassword?: string; +} + /** * @class @@ -4698,15 +4291,3 @@ export interface VulnerabilityAssessmentScanRecordListResult extends Array { readonly nextLink?: string; } - -/** - * @class - * Initializes a new instance of the BackupShortTermRetentionPolicyListResult class. - * @constructor - * A list of short term retention policies. - * - * @member {string} [nextLink] Link to retrieve next page of results. - */ -export interface BackupShortTermRetentionPolicyListResult extends Array { - readonly nextLink?: string; -} diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index a0afe6acc5..1e555f3fde 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -56,6 +56,7 @@ exports.ServiceTierAdvisor = require('./serviceTierAdvisor'); exports.TransparentDataEncryptionActivity = require('./transparentDataEncryptionActivity'); exports.ServerUsage = require('./serverUsage'); exports.DatabaseUsage = require('./databaseUsage'); +exports.DatabaseBlobAuditingPolicy = require('./databaseBlobAuditingPolicy'); exports.AutomaticTuningOptions = require('./automaticTuningOptions'); exports.DatabaseAutomaticTuning = require('./databaseAutomaticTuning'); exports.EncryptionProtector = require('./encryptionProtector'); @@ -88,10 +89,6 @@ exports.SyncGroup = require('./syncGroup'); exports.SyncMember = require('./syncMember'); exports.SubscriptionUsage = require('./subscriptionUsage'); exports.VirtualNetworkRule = require('./virtualNetworkRule'); -exports.ExtendedDatabaseBlobAuditingPolicy = require('./extendedDatabaseBlobAuditingPolicy'); -exports.ExtendedServerBlobAuditingPolicy = require('./extendedServerBlobAuditingPolicy'); -exports.ServerBlobAuditingPolicy = require('./serverBlobAuditingPolicy'); -exports.DatabaseBlobAuditingPolicy = require('./databaseBlobAuditingPolicy'); exports.DatabaseVulnerabilityAssessmentRuleBaselineItem = require('./databaseVulnerabilityAssessmentRuleBaselineItem'); exports.DatabaseVulnerabilityAssessmentRuleBaseline = require('./databaseVulnerabilityAssessmentRuleBaseline'); exports.VulnerabilityAssessmentRecurringScansProperties = require('./vulnerabilityAssessmentRecurringScansProperties'); @@ -119,7 +116,6 @@ 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'); @@ -156,6 +152,7 @@ exports.PartnerRegionInfo = require('./partnerRegionInfo'); exports.ManagedInstancePairInfo = require('./managedInstancePairInfo'); exports.InstanceFailoverGroup = require('./instanceFailoverGroup'); exports.BackupShortTermRetentionPolicy = require('./backupShortTermRetentionPolicy'); +exports.TdeCertificate = require('./tdeCertificate'); exports.RecoverableDatabaseListResult = require('./recoverableDatabaseListResult'); exports.RestorableDroppedDatabaseListResult = require('./restorableDroppedDatabaseListResult'); exports.ServerListResult = require('./serverListResult'); @@ -207,4 +204,3 @@ exports.DatabaseOperationListResult = require('./databaseOperationListResult'); exports.ElasticPoolOperationListResult = require('./elasticPoolOperationListResult'); exports.VulnerabilityAssessmentScanRecordListResult = require('./vulnerabilityAssessmentScanRecordListResult'); exports.InstanceFailoverGroupListResult = require('./instanceFailoverGroupListResult'); -exports.BackupShortTermRetentionPolicyListResult = require('./backupShortTermRetentionPolicyListResult'); diff --git a/lib/services/sqlManagement2/lib/models/tdeCertificate.js b/lib/services/sqlManagement2/lib/models/tdeCertificate.js new file mode 100644 index 0000000000..2c73aecdd2 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/tdeCertificate.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A TDE certificate that can be uploaded into a server. + * + * @extends models['ProxyResource'] + */ +class TdeCertificate extends models['ProxyResource'] { + /** + * Create a TdeCertificate. + * @member {string} privateBlob The base64 encoded certificate private blob. + * @member {string} [certPassword] The certificate password. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TdeCertificate + * + * @returns {object} metadata of TdeCertificate + * + */ + mapper() { + return { + required: false, + serializedName: 'TdeCertificate', + type: { + name: 'Composite', + className: 'TdeCertificate', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + privateBlob: { + required: true, + serializedName: 'properties.privateBlob', + type: { + name: 'String' + } + }, + certPassword: { + required: false, + serializedName: 'properties.certPassword', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TdeCertificate; diff --git a/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js b/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js index 53d6e7016d..4d654af951 100644 --- a/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js @@ -344,158 +344,6 @@ function _update(resourceGroupName, serverName, databaseName, parameters, option }); } -/** - * Gets a database's short term retention 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 {string} databaseName The name of the database. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupShortTermRetentionPolicyListResult} - * for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listByDatabase(resourceGroupName, serverName, databaseName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2017-10-01-preview'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupShortTermRetentionPolicyListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - /** * Updates a database's short term retention policy. * @@ -848,134 +696,6 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o }); } -/** - * Gets a database's short term retention policy. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupShortTermRetentionPolicyListResult} - * for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listByDatabaseNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupShortTermRetentionPolicyListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - /** Class representing a BackupShortTermRetentionPolicies. */ class BackupShortTermRetentionPolicies { /** @@ -987,10 +707,8 @@ class BackupShortTermRetentionPolicies { this._get = _get; this._createOrUpdate = _createOrUpdate; this._update = _update; - this._listByDatabase = _listByDatabase; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginUpdate = _beginUpdate; - this._listByDatabaseNext = _listByDatabaseNext; } /** @@ -1298,101 +1016,6 @@ class BackupShortTermRetentionPolicies { } } - /** - * Gets a database's short term retention 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 {string} databaseName The name of the database. - * - * @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} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByDatabaseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets a database's short term retention 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 {string} databaseName The name of the database. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|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 {BackupShortTermRetentionPolicyListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupShortTermRetentionPolicyListResult} - * for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - /** * Updates a database's short term retention policy. * @@ -1603,91 +1226,6 @@ class BackupShortTermRetentionPolicies { } } - /** - * Gets a database's short term retention policy. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @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} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDatabaseNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets a database's short term retention policy. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|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 {BackupShortTermRetentionPolicyListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BackupShortTermRetentionPolicyListResult} - * for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByDatabaseNext(nextPageLink, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByDatabaseNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDatabaseNext(nextPageLink, options, optionalCallback); - } - } - } module.exports = BackupShortTermRetentionPolicies; diff --git a/lib/services/sqlManagement2/lib/operations/databaseBlobAuditingPolicies.js b/lib/services/sqlManagement2/lib/operations/databaseBlobAuditingPolicies.js index 23e030af5a..767a583790 100644 --- a/lib/services/sqlManagement2/lib/operations/databaseBlobAuditingPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/databaseBlobAuditingPolicies.js @@ -23,7 +23,8 @@ const WebResource = msRest.WebResource; * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the blob + * audit policy is defined. * * @param {object} [options] Optional Parameters. * @@ -55,7 +56,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { throw new Error('callback cannot be null.'); } let blobAuditingPolicyName = 'default'; - let apiVersion = '2017-03-01-preview'; + let apiVersion = '2015-05-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -177,7 +178,8 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the blob + * auditing policy will be defined. * * @param {object} parameters The database blob auditing policy. * @@ -196,84 +198,14 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * @param {number} [parameters.retentionDays] Specifies the number of days to * keep in the audit logs. * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. * * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob * storage subscription Id. * * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. + * storageAccountAccessKey value is the storage’s secondary key. * * @param {object} [options] Optional Parameters. * @@ -305,7 +237,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters throw new Error('callback cannot be null.'); } let blobAuditingPolicyName = 'default'; - let apiVersion = '2017-03-01-preview'; + let apiVersion = '2015-05-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -473,7 +405,8 @@ class DatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the blob + * audit policy is defined. * * @param {object} [options] Optional Parameters. * @@ -509,7 +442,8 @@ class DatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the blob + * audit policy is defined. * * @param {object} [options] Optional Parameters. * @@ -568,7 +502,8 @@ class DatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the blob + * auditing policy will be defined. * * @param {object} parameters The database blob auditing policy. * @@ -587,84 +522,14 @@ class DatabaseBlobAuditingPolicies { * @param {number} [parameters.retentionDays] Specifies the number of days to * keep in the audit logs. * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. * * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob * storage subscription Id. * * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. + * storageAccountAccessKey value is the storage’s secondary key. * * @param {object} [options] Optional Parameters. * @@ -700,7 +565,8 @@ class DatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the blob + * auditing policy will be defined. * * @param {object} parameters The database blob auditing policy. * @@ -719,84 +585,14 @@ class DatabaseBlobAuditingPolicies { * @param {number} [parameters.retentionDays] Specifies the number of days to * keep in the audit logs. * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. * * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob * storage subscription Id. * * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. + * storageAccountAccessKey value is the storage’s secondary key. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentRuleBaselines.js b/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentRuleBaselines.js index e896a697f7..7a53ad9ef5 100644 --- a/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentRuleBaselines.js +++ b/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentRuleBaselines.js @@ -28,10 +28,6 @@ const WebResource = msRest.WebResource; * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -51,7 +47,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, callback) { +function _get(resourceGroupName, serverName, databaseName, ruleId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62,6 +58,7 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, baselineName, throw new Error('callback cannot be null.'); } let vulnerabilityAssessmentName = 'default'; + let baselineName = 'default'; let apiVersion = '2017-03-01-preview'; // Validate try { @@ -77,14 +74,6 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, baselineName, if (ruleId === null || ruleId === undefined || typeof ruleId.valueOf() !== 'string') { throw new Error('ruleId cannot be null or undefined and it must be of type string.'); } - if (baselineName) { - let allowedValues = [ 'master', 'default' ]; - if (!allowedValues.some( function(item) { return item === baselineName; })) { - throw new Error(baselineName + ' is not a valid value. The valid values are: ' + allowedValues); - } - } else { - throw new Error('baselineName cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -202,10 +191,6 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, baselineName, * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} parameters The requested rule baseline resource. * * @param {array} parameters.baselineResults The rule baseline result @@ -229,7 +214,7 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, baselineName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, callback) { +function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -240,6 +225,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, ba throw new Error('callback cannot be null.'); } let vulnerabilityAssessmentName = 'default'; + let baselineName = 'default'; let apiVersion = '2017-03-01-preview'; // Validate try { @@ -255,14 +241,6 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, ba if (ruleId === null || ruleId === undefined || typeof ruleId.valueOf() !== 'string') { throw new Error('ruleId cannot be null or undefined and it must be of type string.'); } - if (baselineName) { - let allowedValues = [ 'master', 'default' ]; - if (!allowedValues.some( function(item) { return item === baselineName; })) { - throw new Error(baselineName + ' is not a valid value. The valid values are: ' + allowedValues); - } - } else { - throw new Error('baselineName cannot be null or undefined.'); - } if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } @@ -397,10 +375,6 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, ba * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -418,7 +392,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, ba * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, callback) { +function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -429,6 +403,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, base throw new Error('callback cannot be null.'); } let vulnerabilityAssessmentName = 'default'; + let baselineName = 'default'; let apiVersion = '2017-03-01-preview'; // Validate try { @@ -444,14 +419,6 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, base if (ruleId === null || ruleId === undefined || typeof ruleId.valueOf() !== 'string') { throw new Error('ruleId cannot be null or undefined and it must be of type string.'); } - if (baselineName) { - let allowedValues = [ 'master', 'default' ]; - if (!allowedValues.some( function(item) { return item === baselineName; })) { - throw new Error(baselineName + ' is not a valid value. The valid values are: ' + allowedValues); - } - } else { - throw new Error('baselineName cannot be null or undefined.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -565,10 +532,6 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -580,11 +543,11 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, baselineName, options) { + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -608,10 +571,6 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -640,7 +599,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback) { + get(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -649,14 +608,14 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback); + return self._get(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback); } } @@ -674,10 +633,6 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} parameters The requested rule baseline resource. * * @param {array} parameters.baselineResults The rule baseline result @@ -693,11 +648,11 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -721,10 +676,6 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} parameters The requested rule baseline resource. * * @param {array} parameters.baselineResults The rule baseline result @@ -757,7 +708,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -766,14 +717,14 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, optionalCallback); } } @@ -791,10 +742,6 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -806,11 +753,11 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, baselineName, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -834,10 +781,6 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -864,7 +807,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback) { + deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -873,14 +816,14 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback); + return self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index f1fef62398..932c21e7e1 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -8930,6 +8930,207 @@ export interface DatabaseUsages { listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * DatabaseBlobAuditingPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseBlobAuditingPolicies { + + + /** + * Gets a database's blob auditing 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 {string} databaseName The name of the database for which the blob + * audit policy is defined. + * + * @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} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database's blob auditing 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 {string} databaseName The name of the database for which the blob + * audit policy is defined. + * + * @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 {DatabaseBlobAuditingPolicy} - 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. + * + * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseBlobAuditingPolicy} 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, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a database's blob auditing 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 {string} databaseName The name of the database for which the blob + * auditing policy will be defined. + * + * @param {object} parameters The database blob auditing policy. + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is + * Enabled, storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. + * + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. + * + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. + * + * @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} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a database's blob auditing 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 {string} databaseName The name of the database for which the blob + * auditing policy will be defined. + * + * @param {object} parameters The database blob auditing policy. + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is + * Enabled, storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. + * + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. + * + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. + * + * @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 {DatabaseBlobAuditingPolicy} - 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. + * + * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseBlobAuditingPolicy} 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, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * DatabaseAutomaticTuningOperations @@ -16394,15 +16595,15 @@ export interface VirtualNetworkRules { /** * @class - * ExtendedDatabaseBlobAuditingPolicies + * DatabaseVulnerabilityAssessmentRuleBaselines * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ExtendedDatabaseBlobAuditingPolicies { +export interface DatabaseVulnerabilityAssessmentRuleBaselines { /** - * Gets an extended database's blob auditing policy. + * Gets a database's vulnerability assessment rule baseline. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -16410,7 +16611,10 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. + * + * @param {string} ruleId The vulnerability assessment rule ID. * * @param {object} [options] Optional Parameters. * @@ -16419,14 +16623,14 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets an extended database's blob auditing policy. + * Gets a database's vulnerability assessment rule baseline. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -16434,7 +16638,10 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. + * + * @param {string} ruleId The vulnerability assessment rule ID. * * @param {object} [options] Optional Parameters. * @@ -16448,7 +16655,7 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * {Promise} A promise is returned. * - * @resolve {ExtendedDatabaseBlobAuditingPolicy} - The deserialized result object. + * @resolve {DatabaseVulnerabilityAssessmentRuleBaseline} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16456,21 +16663,21 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ExtendedDatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ExtendedDatabaseBlobAuditingPolicy} for more - * information. + * {DatabaseVulnerabilityAssessmentRuleBaseline} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseVulnerabilityAssessmentRuleBaseline} + * 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, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an extended database's blob auditing policy. + * Creates or updates a database's vulnerability assessment rule baseline. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -16478,106 +16685,14 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters The extended database blob auditing policy. - * - * @param {string} [parameters.predicateExpression] Specifies condition of - * where clause when creating an audit. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. + * @param {object} parameters The requested rule baseline resource. * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. + * @param {array} parameters.baselineResults The rule baseline result * * @param {object} [options] Optional Parameters. * @@ -16586,14 +16701,14 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExtendedDatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an extended database's blob auditing policy. + * Creates or updates a database's vulnerability assessment rule baseline. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -16601,1811 +16716,19 @@ export interface ExtendedDatabaseBlobAuditingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. * - * @param {object} parameters The extended database blob auditing policy. + * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} [parameters.predicateExpression] Specifies condition of - * where clause when creating an audit. + * @param {object} parameters The requested rule baseline resource. * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' + * @param {array} parameters.baselineResults The rule baseline result * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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 {ExtendedDatabaseBlobAuditingPolicy} - 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. - * - * {ExtendedDatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ExtendedDatabaseBlobAuditingPolicy} 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, databaseName: string, parameters: models.ExtendedDatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExtendedDatabaseBlobAuditingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExtendedDatabaseBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExtendedServerBlobAuditingPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ExtendedServerBlobAuditingPolicies { - - - /** - * Gets an extended server's blob auditing 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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets an extended server's blob auditing 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 {ExtendedServerBlobAuditingPolicy} - 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. - * - * {ExtendedServerBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ExtendedServerBlobAuditingPolicy} 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; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an extended server's blob auditing 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 Properties of extended blob auditing policy - * - * @param {string} [parameters.predicateExpression] Specifies condition of - * where clause when creating an audit. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an extended server's blob auditing 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 Properties of extended blob auditing policy - * - * @param {string} [parameters.predicateExpression] Specifies condition of - * where clause when creating an audit. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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 {ExtendedServerBlobAuditingPolicy} - 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. - * - * {ExtendedServerBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ExtendedServerBlobAuditingPolicy} 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.ExtendedServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an extended server's blob auditing 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 Properties of extended blob auditing policy - * - * @param {string} [parameters.predicateExpression] Specifies condition of - * where clause when creating an audit. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an extended server's blob auditing 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 Properties of extended blob auditing policy - * - * @param {string} [parameters.predicateExpression] Specifies condition of - * where clause when creating an audit. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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 {ExtendedServerBlobAuditingPolicy} - 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. - * - * {ExtendedServerBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ExtendedServerBlobAuditingPolicy} 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.ExtendedServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerBlobAuditingPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerBlobAuditingPolicies { - - - /** - * Gets a server's blob auditing 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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a server's blob auditing 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 {ServerBlobAuditingPolicy} - 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. - * - * {ServerBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServerBlobAuditingPolicy} 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; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a server's blob auditing 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 Properties of blob auditing policy - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a server's blob auditing 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 Properties of blob auditing policy - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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 {ServerBlobAuditingPolicy} - 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. - * - * {ServerBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServerBlobAuditingPolicy} 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.ServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a server's blob auditing 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 Properties of blob auditing policy - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a server's blob auditing 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 Properties of blob auditing policy - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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 {ServerBlobAuditingPolicy} - 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. - * - * {ServerBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServerBlobAuditingPolicy} 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.ServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseBlobAuditingPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseBlobAuditingPolicies { - - - /** - * Gets a database's blob auditing 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 {string} databaseName The name of the database. - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a database's blob auditing 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 {string} databaseName The name of the database. - * - * @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 {DatabaseBlobAuditingPolicy} - 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. - * - * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseBlobAuditingPolicy} 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, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a database's blob auditing 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 {string} databaseName The name of the database. - * - * @param {object} parameters The database blob auditing policy. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a database's blob auditing 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 {string} databaseName The name of the database. - * - * @param {object} parameters The database blob auditing policy. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. - * - * @param {array} [parameters.auditActionsAndGroups] Specifies the - * Actions-Groups and Actions to audit. - * - * The recommended set of action groups to use is the following combination - - * this will audit all the queries and stored procedures executed against the - * database, as well as successful and failed logins: - * - * BATCH_COMPLETED_GROUP, - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - * FAILED_DATABASE_AUTHENTICATION_GROUP. - * - * This above combination is also the set that is configured by default when - * enabling auditing from the Azure portal. - * - * The supported action groups to audit are (note: choose only specific groups - * that cover your auditing needs. Using unnecessary groups could lead to very - * large quantities of audit records): - * - * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - * BACKUP_RESTORE_GROUP - * DATABASE_LOGOUT_GROUP - * DATABASE_OBJECT_CHANGE_GROUP - * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - * DATABASE_OPERATION_GROUP - * DATABASE_PERMISSION_CHANGE_GROUP - * DATABASE_PRINCIPAL_CHANGE_GROUP - * DATABASE_PRINCIPAL_IMPERSONATION_GROUP - * DATABASE_ROLE_MEMBER_CHANGE_GROUP - * FAILED_DATABASE_AUTHENTICATION_GROUP - * SCHEMA_OBJECT_ACCESS_GROUP - * SCHEMA_OBJECT_CHANGE_GROUP - * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - * USER_CHANGE_PASSWORD_GROUP - * BATCH_STARTED_GROUP - * BATCH_COMPLETED_GROUP - * - * These are groups that cover all sql statements and stored procedures - * executed against the database, and should not be used in combination with - * other groups as this will result in duplicate audit logs. - * - * For more information, see [Database-Level Audit Action - * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). - * - * For Database auditing policy, specific Actions can also be specified (note - * that Actions cannot be specified for Server auditing policy). The supported - * actions to audit are: - * SELECT - * UPDATE - * INSERT - * DELETE - * EXECUTE - * RECEIVE - * REFERENCES - * - * The general form for defining an action to be audited is: - * ON BY - * - * Note that in the above format can refer to an object like a table, - * view, or stored procedure, or an entire database or schema. For the latter - * cases, the forms DATABASE:: and SCHEMA:: are used, - * respectively. - * - * For example: - * SELECT on dbo.myTable by public - * SELECT on DATABASE::myDatabase by public - * SELECT on SCHEMA::mySchema by public - * - * For more information, see [Database-Level Audit - * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) - * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. - * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage's secondary key. - * - * @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 {DatabaseBlobAuditingPolicy} - 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. - * - * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseBlobAuditingPolicy} 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, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseVulnerabilityAssessmentRuleBaselines - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseVulnerabilityAssessmentRuleBaselines { - - - /** - * Gets a database's vulnerability assessment rule baseline. - * - * @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 {string} databaseName The name of the database for which the - * vulnerability assessment rule baseline is defined. - * - * @param {string} ruleId The vulnerability assessment rule ID. - * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a database's vulnerability assessment rule baseline. - * - * @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 {string} databaseName The name of the database for which the - * vulnerability assessment rule baseline is defined. - * - * @param {string} ruleId The vulnerability assessment rule ID. - * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * - * @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 {DatabaseVulnerabilityAssessmentRuleBaseline} - 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. - * - * {DatabaseVulnerabilityAssessmentRuleBaseline} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseVulnerabilityAssessmentRuleBaseline} - * 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, databaseName: string, ruleId: string, baselineName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a database's vulnerability assessment rule baseline. - * - * @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 {string} databaseName The name of the database for which the - * vulnerability assessment rule baseline is defined. - * - * @param {string} ruleId The vulnerability assessment rule ID. - * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * - * @param {object} parameters The requested rule baseline resource. - * - * @param {array} parameters.baselineResults The rule baseline result - * - * @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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a database's vulnerability assessment rule baseline. - * - * @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 {string} databaseName The name of the database for which the - * vulnerability assessment rule baseline is defined. - * - * @param {string} ruleId The vulnerability assessment rule ID. - * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * - * @param {object} parameters The requested rule baseline resource. - * - * @param {array} parameters.baselineResults The rule baseline result - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [options.customHeaders] Headers that will be added to the + * request * * @param {ServiceCallback} [optionalCallback] - The optional callback. * @@ -18430,9 +16753,9 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -18449,10 +16772,6 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18464,7 +16783,7 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Removes the database's vulnerability assessment rule baseline. @@ -18480,10 +16799,6 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} baselineName The name of the vulnerability assessment rule - * baseline (default implies a baseline on a database level rule and master for - * server level rule). Possible values include: 'master', 'default' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18510,9 +16825,9 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -25737,322 +24052,17 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of server DNS aliases for a server. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @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 {ServerDnsAliasListResult} - 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. - * - * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAliasListResult} 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. - */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): 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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): 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} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * 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; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): 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} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a list of server DNS aliases for a server. * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -26066,7 +24076,7 @@ export interface ServerSecurityAlertPolicies { * * {Promise} A promise is returned. * - * @resolve {ServerSecurityAlertPolicy} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -26074,17 +24084,17 @@ export interface ServerSecurityAlertPolicies { * * {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 + * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} 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; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -28486,7 +26496,7 @@ export interface BackupShortTermRetentionPolicies { /** - * Gets a database's short term retention policy. + * Updates a database's short term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -28496,6 +26506,11 @@ export interface BackupShortTermRetentionPolicies { * * @param {string} databaseName The name of the database. * + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -28503,14 +26518,14 @@ export interface BackupShortTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's short term retention policy. + * Updates a database's short term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -28520,6 +26535,11 @@ export interface BackupShortTermRetentionPolicies { * * @param {string} databaseName The name of the database. * + * @param {object} parameters The short term retention policy info. + * + * @param {number} [parameters.retentionDays] The backup retention period in + * days. This is how many days Point-in-Time Restore will be supported. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -28532,7 +26552,7 @@ export interface BackupShortTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupShortTermRetentionPolicyListResult} - The deserialized result object. + * @resolve {BackupShortTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28540,17 +26560,17 @@ export interface BackupShortTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupShortTermRetentionPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BackupShortTermRetentionPolicyListResult} - * for more information. + * {BackupShortTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupShortTermRetentionPolicy} 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. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -28580,7 +26600,7 @@ export interface BackupShortTermRetentionPolicies { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a database's short term retention policy. @@ -28626,13 +26646,22 @@ export interface BackupShortTermRetentionPolicies { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * TdeCertificates + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface TdeCertificates { /** - * Updates a database's short term retention policy. + * Creates a TDE certificate for a given server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -28640,12 +26669,13 @@ export interface BackupShortTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {object} parameters The requested TDE certificate to be created or + * updated. * - * @param {object} parameters The short term retention policy info. + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. * - * @param {number} [parameters.retentionDays] The backup retention period in - * days. This is how many days Point-in-Time Restore will be supported. + * @param {string} [parameters.certPassword] The certificate password. * * @param {object} [options] Optional Parameters. * @@ -28654,14 +26684,14 @@ export interface BackupShortTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a database's short term retention policy. + * Creates a TDE certificate for a given server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -28669,12 +26699,13 @@ export interface BackupShortTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {object} parameters The requested TDE certificate to be created or + * updated. * - * @param {object} parameters The short term retention policy info. + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. * - * @param {number} [parameters.retentionDays] The backup retention period in - * days. This is how many days Point-in-Time Restore will be supported. + * @param {string} [parameters.certPassword] The certificate password. * * @param {object} [options] Optional Parameters. * @@ -28688,7 +26719,7 @@ export interface BackupShortTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupShortTermRetentionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28696,24 +26727,33 @@ export interface BackupShortTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupShortTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupShortTermRetentionPolicy} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {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. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database's short term retention policy. + * Creates a TDE certificate for a given server. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. * * @param {object} [options] Optional Parameters. * @@ -28722,17 +26762,28 @@ export interface BackupShortTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's short term retention policy. + * Creates a TDE certificate for a given server. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. * * @param {object} [options] Optional Parameters. * @@ -28746,7 +26797,7 @@ export interface BackupShortTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupShortTermRetentionPolicyListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -28754,15 +26805,178 @@ export interface BackupShortTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupShortTermRetentionPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BackupShortTermRetentionPolicyListResult} - * for more information. + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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. + */ + beginCreate(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, parameters: models.TdeCertificate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ManagedInstanceTdeCertificates + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ManagedInstanceTdeCertificates { + + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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 {null} - 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. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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. + */ + create(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, callback: ServiceCallback): void; + create(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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 {null} - 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. + * + * {null} [result] - The deserialized result object if an error did not occur. * * {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. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, managedInstanceName: string, parameters: models.TdeCertificate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 15c3b3912e..592af86dc9 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -37,6 +37,7 @@ exports.TransparentDataEncryptions = require('./transparentDataEncryptions'); exports.TransparentDataEncryptionActivities = require('./transparentDataEncryptionActivities'); exports.ServerUsages = require('./serverUsages'); exports.DatabaseUsages = require('./databaseUsages'); +exports.DatabaseBlobAuditingPolicies = require('./databaseBlobAuditingPolicies'); exports.DatabaseAutomaticTuningOperations = require('./databaseAutomaticTuningOperations'); exports.EncryptionProtectors = require('./encryptionProtectors'); exports.FailoverGroups = require('./failoverGroups'); @@ -48,10 +49,6 @@ exports.SyncGroups = require('./syncGroups'); exports.SyncMembers = require('./syncMembers'); exports.SubscriptionUsages = require('./subscriptionUsages'); exports.VirtualNetworkRules = require('./virtualNetworkRules'); -exports.ExtendedDatabaseBlobAuditingPolicies = require('./extendedDatabaseBlobAuditingPolicies'); -exports.ExtendedServerBlobAuditingPolicies = require('./extendedServerBlobAuditingPolicies'); -exports.ServerBlobAuditingPolicies = require('./serverBlobAuditingPolicies'); -exports.DatabaseBlobAuditingPolicies = require('./databaseBlobAuditingPolicies'); exports.DatabaseVulnerabilityAssessmentRuleBaselines = require('./databaseVulnerabilityAssessmentRuleBaselines'); exports.DatabaseVulnerabilityAssessments = require('./databaseVulnerabilityAssessments'); exports.JobAgents = require('./jobAgents'); @@ -68,7 +65,6 @@ 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'); @@ -76,3 +72,5 @@ exports.Capabilities = require('./capabilities'); exports.DatabaseVulnerabilityAssessmentScans = require('./databaseVulnerabilityAssessmentScans'); exports.InstanceFailoverGroups = require('./instanceFailoverGroups'); exports.BackupShortTermRetentionPolicies = require('./backupShortTermRetentionPolicies'); +exports.TdeCertificates = require('./tdeCertificates'); +exports.ManagedInstanceTdeCertificates = require('./managedInstanceTdeCertificates'); diff --git a/lib/services/sqlManagement2/lib/operations/managedInstanceTdeCertificates.js b/lib/services/sqlManagement2/lib/operations/managedInstanceTdeCertificates.js new file mode 100644 index 0000000000..2369d9a9c8 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/managedInstanceTdeCertificates.js @@ -0,0 +1,466 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _create(resourceGroupName, managedInstanceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, managedInstanceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreate(resourceGroupName, managedInstanceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TdeCertificate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ManagedInstanceTdeCertificates. */ +class ManagedInstanceTdeCertificates { + /** + * Create a ManagedInstanceTdeCertificates. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._create = _create; + this._beginCreate = _beginCreate; + } + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + create(resourceGroupName, managedInstanceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a TDE certificate for a given server. + * + * @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} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + +} + +module.exports = ManagedInstanceTdeCertificates; diff --git a/lib/services/sqlManagement2/lib/operations/tdeCertificates.js b/lib/services/sqlManagement2/lib/operations/tdeCertificates.js new file mode 100644 index 0000000000..709b3415ff --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/tdeCertificates.js @@ -0,0 +1,466 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Creates a TDE certificate for a given server. + * + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _create(resourceGroupName, serverName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, serverName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a TDE certificate for a given server. + * + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreate(resourceGroupName, serverName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TdeCertificate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a TdeCertificates. */ +class TdeCertificates { + /** + * Create a TdeCertificates. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._create = _create; + this._beginCreate = _beginCreate; + } + + /** + * Creates a TDE certificate for a given server. + * + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a TDE certificate for a given server. + * + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + create(resourceGroupName, serverName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, serverName, parameters, options, optionalCallback); + } + } + + /** + * Creates a TDE certificate for a given server. + * + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @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} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a TDE certificate for a given server. + * + * @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 requested TDE certificate to be created or + * updated. + * + * @param {string} parameters.privateBlob The base64 encoded certificate + * private blob. + * + * @param {string} [parameters.certPassword] The certificate password. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|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 {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreate(resourceGroupName, serverName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, serverName, parameters, options, optionalCallback); + } + } + +} + +module.exports = TdeCertificates; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 9bc8b10077..8fa0288e8b 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -77,6 +77,7 @@ export default class SqlManagementClient extends AzureServiceClient { transparentDataEncryptionActivities: operations.TransparentDataEncryptionActivities; serverUsages: operations.ServerUsages; databaseUsages: operations.DatabaseUsages; + databaseBlobAuditingPolicies: operations.DatabaseBlobAuditingPolicies; databaseAutomaticTuningOperations: operations.DatabaseAutomaticTuningOperations; encryptionProtectors: operations.EncryptionProtectors; failoverGroups: operations.FailoverGroups; @@ -88,10 +89,6 @@ export default class SqlManagementClient extends AzureServiceClient { syncMembers: operations.SyncMembers; subscriptionUsages: operations.SubscriptionUsages; virtualNetworkRules: operations.VirtualNetworkRules; - extendedDatabaseBlobAuditingPolicies: operations.ExtendedDatabaseBlobAuditingPolicies; - extendedServerBlobAuditingPolicies: operations.ExtendedServerBlobAuditingPolicies; - serverBlobAuditingPolicies: operations.ServerBlobAuditingPolicies; - databaseBlobAuditingPolicies: operations.DatabaseBlobAuditingPolicies; databaseVulnerabilityAssessmentRuleBaselines: operations.DatabaseVulnerabilityAssessmentRuleBaselines; databaseVulnerabilityAssessments: operations.DatabaseVulnerabilityAssessments; jobAgents: operations.JobAgents; @@ -108,7 +105,6 @@ 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; @@ -116,6 +112,8 @@ export default class SqlManagementClient extends AzureServiceClient { databaseVulnerabilityAssessmentScans: operations.DatabaseVulnerabilityAssessmentScans; instanceFailoverGroups: operations.InstanceFailoverGroups; backupShortTermRetentionPolicies: operations.BackupShortTermRetentionPolicies; + tdeCertificates: operations.TdeCertificates; + managedInstanceTdeCertificates: operations.ManagedInstanceTdeCertificates; } export { SqlManagementClient, models as SqlManagementModels }; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index 5bcff3d4c5..d2c64dd612 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -94,6 +94,7 @@ class SqlManagementClient extends ServiceClient { this.transparentDataEncryptionActivities = new operations.TransparentDataEncryptionActivities(this); this.serverUsages = new operations.ServerUsages(this); this.databaseUsages = new operations.DatabaseUsages(this); + this.databaseBlobAuditingPolicies = new operations.DatabaseBlobAuditingPolicies(this); this.databaseAutomaticTuningOperations = new operations.DatabaseAutomaticTuningOperations(this); this.encryptionProtectors = new operations.EncryptionProtectors(this); this.failoverGroups = new operations.FailoverGroups(this); @@ -105,10 +106,6 @@ class SqlManagementClient extends ServiceClient { this.syncMembers = new operations.SyncMembers(this); this.subscriptionUsages = new operations.SubscriptionUsages(this); this.virtualNetworkRules = new operations.VirtualNetworkRules(this); - this.extendedDatabaseBlobAuditingPolicies = new operations.ExtendedDatabaseBlobAuditingPolicies(this); - this.extendedServerBlobAuditingPolicies = new operations.ExtendedServerBlobAuditingPolicies(this); - this.serverBlobAuditingPolicies = new operations.ServerBlobAuditingPolicies(this); - this.databaseBlobAuditingPolicies = new operations.DatabaseBlobAuditingPolicies(this); this.databaseVulnerabilityAssessmentRuleBaselines = new operations.DatabaseVulnerabilityAssessmentRuleBaselines(this); this.databaseVulnerabilityAssessments = new operations.DatabaseVulnerabilityAssessments(this); this.jobAgents = new operations.JobAgents(this); @@ -125,7 +122,6 @@ 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); @@ -133,6 +129,8 @@ class SqlManagementClient extends ServiceClient { this.databaseVulnerabilityAssessmentScans = new operations.DatabaseVulnerabilityAssessmentScans(this); this.instanceFailoverGroups = new operations.InstanceFailoverGroups(this); this.backupShortTermRetentionPolicies = new operations.BackupShortTermRetentionPolicies(this); + this.tdeCertificates = new operations.TdeCertificates(this); + this.managedInstanceTdeCertificates = new operations.ManagedInstanceTdeCertificates(this); this.models = models; msRest.addSerializationMixin(this); }