diff --git a/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js b/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js index 37930527f8..f08cff6de8 100644 --- a/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js +++ b/lib/services/sqlManagement2/lib/models/databaseBlobAuditingPolicy.js @@ -32,12 +32,82 @@ 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 and - * Actions-Groups to audit. + * @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. + * storageAccountAccessKey value is the storage's secondary key. */ constructor() { super(); diff --git a/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessment.js b/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessment.js index 375f0771a8..66aa2ac427 100644 --- a/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessment.js +++ b/lib/services/sqlManagement2/lib/models/databaseVulnerabilityAssessment.js @@ -23,9 +23,13 @@ class DatabaseVulnerabilityAssessment extends models['ProxyResource'] { * @member {string} storageContainerPath A blob storage container path to * hold the scan results (e.g. * https://myStorage.blob.core.windows.net/VaScans/). - * @member {string} storageContainerSasKey A shared access signature (SAS + * @member {string} [storageContainerSasKey] A shared access signature (SAS * Key) that has write access to the blob container specified in - * 'storageContainerPath' parameter. + * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the auditing storage account. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required. * @member {object} [recurringScans] The recurring scans settings * @member {boolean} [recurringScans.isEnabled] Recurring scans state. * @member {boolean} [recurringScans.emailSubscriptionAdmins] Specifies that @@ -84,12 +88,19 @@ class DatabaseVulnerabilityAssessment extends models['ProxyResource'] { } }, storageContainerSasKey: { - required: true, + required: false, serializedName: 'properties.storageContainerSasKey', type: { name: 'String' } }, + storageAccountAccessKey: { + required: false, + serializedName: 'properties.storageAccountAccessKey', + type: { + name: 'String' + } + }, recurringScans: { required: false, serializedName: 'properties.recurringScans', diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index 8eeadb3e7e..e8a6f7484f 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -1064,42 +1064,6 @@ 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. @@ -1891,6 +1855,430 @@ 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. @@ -1943,9 +2331,13 @@ export interface VulnerabilityAssessmentRecurringScansProperties { * * @member {string} storageContainerPath A blob storage container path to hold * the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). - * @member {string} storageContainerSasKey A shared access signature (SAS Key) - * that has write access to the blob container specified in - * 'storageContainerPath' parameter. + * @member {string} [storageContainerSasKey] A shared access signature (SAS + * Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the auditing storage account. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required. * @member {object} [recurringScans] The recurring scans settings * @member {boolean} [recurringScans.isEnabled] Recurring scans state. * @member {boolean} [recurringScans.emailSubscriptionAdmins] Specifies that @@ -1956,7 +2348,8 @@ export interface VulnerabilityAssessmentRecurringScansProperties { */ export interface DatabaseVulnerabilityAssessment extends ProxyResource { storageContainerPath: string; - storageContainerSasKey: string; + storageContainerSasKey?: string; + storageAccountAccessKey?: string; recurringScans?: VulnerabilityAssessmentRecurringScansProperties; } @@ -2474,6 +2867,20 @@ export interface ManagedDatabaseUpdate { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the SensitivityLabel class. + * @constructor + * A sensitivity label. + * + * @member {string} [labelName] The label name. + * @member {string} [informationType] The information type. + */ +export interface SensitivityLabel extends ProxyResource { + labelName?: string; + informationType?: string; +} + /** * @class * Initializes a new instance of the AutomaticTuningServerOptions class. @@ -2540,6 +2947,39 @@ export interface ServerDnsAliasAcquisition { oldServerDnsAliasId?: string; } +/** + * @class + * Initializes a new instance of the ServerSecurityAlertPolicy class. + * @constructor + * A server security alert policy. + * + * @member {string} state Specifies the state of the policy, whether it is + * enabled or disabled. Possible values include: 'New', 'Enabled', 'Disabled' + * @member {array} [disabledAlerts] Specifies an array of alerts that are + * disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, + * Access_Anomaly + * @member {array} [emailAddresses] Specifies an array of e-mail addresses to + * which the alert is sent. + * @member {boolean} [emailAccountAdmins] Specifies that the alert is sent to + * the account administrators. + * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all + * Threat Detection audit logs. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the Threat Detection audit storage account. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * Threat Detection audit logs. + */ +export interface ServerSecurityAlertPolicy extends ProxyResource { + state: string; + disabledAlerts?: string[]; + emailAddresses?: string[]; + emailAccountAdmins?: boolean; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; +} + /** * @class * Initializes a new instance of the RestorePoint class. @@ -4220,6 +4660,18 @@ export interface ManagedDatabaseListResult extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the SensitivityLabelListResult class. + * @constructor + * A list of sensitivity labels. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface SensitivityLabelListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the ServerDnsAliasListResult class. @@ -4291,3 +4743,15 @@ 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 1e555f3fde..8943576e6e 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -56,7 +56,6 @@ 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'); @@ -89,6 +88,10 @@ 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'); @@ -112,10 +115,12 @@ exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy exports.CompleteDatabaseRestoreDefinition = require('./completeDatabaseRestoreDefinition'); exports.ManagedDatabase = require('./managedDatabase'); exports.ManagedDatabaseUpdate = require('./managedDatabaseUpdate'); +exports.SensitivityLabel = require('./sensitivityLabel'); 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'); @@ -198,9 +203,11 @@ exports.JobTargetGroupListResult = require('./jobTargetGroupListResult'); exports.JobVersionListResult = require('./jobVersionListResult'); exports.LongTermRetentionBackupListResult = require('./longTermRetentionBackupListResult'); exports.ManagedDatabaseListResult = require('./managedDatabaseListResult'); +exports.SensitivityLabelListResult = require('./sensitivityLabelListResult'); exports.ServerDnsAliasListResult = require('./serverDnsAliasListResult'); exports.RestorePointListResult = require('./restorePointListResult'); 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/sensitivityLabel.js b/lib/services/sqlManagement2/lib/models/sensitivityLabel.js new file mode 100644 index 0000000000..935d580335 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/sensitivityLabel.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 sensitivity label. + * + * @extends models['ProxyResource'] + */ +class SensitivityLabel extends models['ProxyResource'] { + /** + * Create a SensitivityLabel. + * @member {string} [labelName] The label name. + * @member {string} [informationType] The information type. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SensitivityLabel + * + * @returns {object} metadata of SensitivityLabel + * + */ + mapper() { + return { + required: false, + serializedName: 'SensitivityLabel', + type: { + name: 'Composite', + className: 'SensitivityLabel', + 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' + } + }, + labelName: { + required: false, + serializedName: 'properties.labelName', + type: { + name: 'String' + } + }, + informationType: { + required: false, + serializedName: 'properties.informationType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SensitivityLabel; diff --git a/lib/services/sqlManagement2/lib/models/sensitivityLabelListResult.js b/lib/services/sqlManagement2/lib/models/sensitivityLabelListResult.js new file mode 100644 index 0000000000..ab47324930 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/sensitivityLabelListResult.js @@ -0,0 +1,69 @@ +/* + * 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'; + +/** + * A list of sensitivity labels. + */ +class SensitivityLabelListResult extends Array { + /** + * Create a SensitivityLabelListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SensitivityLabelListResult + * + * @returns {object} metadata of SensitivityLabelListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SensitivityLabelListResult', + type: { + name: 'Composite', + className: 'SensitivityLabelListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SensitivityLabelElementType', + type: { + name: 'Composite', + className: 'SensitivityLabel' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SensitivityLabelListResult; diff --git a/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js b/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js index 4d654af951..53d6e7016d 100644 --- a/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/backupShortTermRetentionPolicies.js @@ -344,6 +344,158 @@ 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. * @@ -696,6 +848,134 @@ 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 { /** @@ -707,8 +987,10 @@ class BackupShortTermRetentionPolicies { this._get = _get; this._createOrUpdate = _createOrUpdate; this._update = _update; + this._listByDatabase = _listByDatabase; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginUpdate = _beginUpdate; + this._listByDatabaseNext = _listByDatabaseNext; } /** @@ -1016,6 +1298,101 @@ 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. * @@ -1226,6 +1603,91 @@ 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 767a583790..23e030af5a 100644 --- a/lib/services/sqlManagement2/lib/operations/databaseBlobAuditingPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/databaseBlobAuditingPolicies.js @@ -23,8 +23,7 @@ const WebResource = msRest.WebResource; * * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -56,7 +55,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { throw new Error('callback cannot be null.'); } let blobAuditingPolicyName = 'default'; - let apiVersion = '2015-05-01-preview'; + let apiVersion = '2017-03-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -178,8 +177,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * @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 {string} databaseName The name of the database. * * @param {object} parameters The database blob auditing policy. * @@ -198,14 +196,84 @@ 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 and - * Actions-Groups to audit. + * @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. + * storageAccountAccessKey value is the storage's secondary key. * * @param {object} [options] Optional Parameters. * @@ -237,7 +305,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters throw new Error('callback cannot be null.'); } let blobAuditingPolicyName = 'default'; - let apiVersion = '2015-05-01-preview'; + let apiVersion = '2017-03-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -405,8 +473,7 @@ class DatabaseBlobAuditingPolicies { * * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -442,8 +509,7 @@ class DatabaseBlobAuditingPolicies { * * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -502,8 +568,7 @@ class DatabaseBlobAuditingPolicies { * * @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 {string} databaseName The name of the database. * * @param {object} parameters The database blob auditing policy. * @@ -522,14 +587,84 @@ class DatabaseBlobAuditingPolicies { * @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 {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. + * storageAccountAccessKey value is the storage's secondary key. * * @param {object} [options] Optional Parameters. * @@ -565,8 +700,7 @@ class DatabaseBlobAuditingPolicies { * * @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 {string} databaseName The name of the database. * * @param {object} parameters The database blob auditing policy. * @@ -585,14 +719,84 @@ class DatabaseBlobAuditingPolicies { * @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 {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. + * 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 7a53ad9ef5..e896a697f7 100644 --- a/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentRuleBaselines.js +++ b/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessmentRuleBaselines.js @@ -28,6 +28,10 @@ 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 @@ -47,7 +51,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, databaseName, ruleId, options, callback) { +function _get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58,7 +62,6 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, options, call throw new Error('callback cannot be null.'); } let vulnerabilityAssessmentName = 'default'; - let baselineName = 'default'; let apiVersion = '2017-03-01-preview'; // Validate try { @@ -74,6 +77,14 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, options, call 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.'); } @@ -191,6 +202,10 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, options, call * * @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 @@ -214,7 +229,7 @@ function _get(resourceGroupName, serverName, databaseName, ruleId, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, callback) { +function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -225,7 +240,6 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, pa throw new Error('callback cannot be null.'); } let vulnerabilityAssessmentName = 'default'; - let baselineName = 'default'; let apiVersion = '2017-03-01-preview'; // Validate try { @@ -241,6 +255,14 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, pa 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.'); } @@ -375,6 +397,10 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, pa * * @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 @@ -392,7 +418,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, pa * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, callback) { +function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -403,7 +429,6 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, opti throw new Error('callback cannot be null.'); } let vulnerabilityAssessmentName = 'default'; - let baselineName = 'default'; let apiVersion = '2017-03-01-preview'; // Validate try { @@ -419,6 +444,14 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, ruleId, opti 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.'); } @@ -532,6 +565,10 @@ 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 @@ -543,11 +580,11 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, options) { + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, baselineName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -571,6 +608,10 @@ 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 @@ -599,7 +640,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback) { + get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -608,14 +649,14 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { + self._get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback); + return self._get(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback); } } @@ -633,6 +674,10 @@ 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 @@ -648,11 +693,11 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, parameters, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -676,6 +721,10 @@ 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 @@ -708,7 +757,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -717,14 +766,14 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, databaseName, ruleId, baselineName, parameters, options, optionalCallback); } } @@ -742,6 +791,10 @@ 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 @@ -753,11 +806,11 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, ruleId, baselineName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -781,6 +834,10 @@ 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 @@ -807,7 +864,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback) { + deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -816,14 +873,14 @@ class DatabaseVulnerabilityAssessmentRuleBaselines { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, options, optionalCallback); + return self._deleteMethod(resourceGroupName, serverName, databaseName, ruleId, baselineName, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessments.js b/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessments.js index 15e382de4e..afe4be74ac 100644 --- a/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessments.js +++ b/lib/services/sqlManagement2/lib/operations/databaseVulnerabilityAssessments.js @@ -187,9 +187,14 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * path to hold the scan results (e.g. * https://myStorage.blob.core.windows.net/VaScans/). * - * @param {string} parameters.storageContainerSasKey A shared access signature - * (SAS Key) that has write access to the blob container specified in - * 'storageContainerPath' parameter. + * @param {string} [parameters.storageContainerSasKey] A shared access + * signature (SAS Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If 'StorageContainerSasKey' + * isn't specified, storageAccountAccessKey is required. * * @param {object} [parameters.recurringScans] The recurring scans settings * @@ -644,9 +649,14 @@ class DatabaseVulnerabilityAssessments { * path to hold the scan results (e.g. * https://myStorage.blob.core.windows.net/VaScans/). * - * @param {string} parameters.storageContainerSasKey A shared access signature - * (SAS Key) that has write access to the blob container specified in - * 'storageContainerPath' parameter. + * @param {string} [parameters.storageContainerSasKey] A shared access + * signature (SAS Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If 'StorageContainerSasKey' + * isn't specified, storageAccountAccessKey is required. * * @param {object} [parameters.recurringScans] The recurring scans settings * @@ -703,9 +713,14 @@ class DatabaseVulnerabilityAssessments { * path to hold the scan results (e.g. * https://myStorage.blob.core.windows.net/VaScans/). * - * @param {string} parameters.storageContainerSasKey A shared access signature - * (SAS Key) that has write access to the blob container specified in - * 'storageContainerPath' parameter. + * @param {string} [parameters.storageContainerSasKey] A shared access + * signature (SAS Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If 'StorageContainerSasKey' + * isn't specified, storageAccountAccessKey is required. * * @param {object} [parameters.recurringScans] The recurring scans settings * diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index 932c21e7e1..26635bf059 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -8930,207 +8930,6 @@ 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 @@ -16595,15 +16394,15 @@ export interface VirtualNetworkRules { /** * @class - * DatabaseVulnerabilityAssessmentRuleBaselines + * ExtendedDatabaseBlobAuditingPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DatabaseVulnerabilityAssessmentRuleBaselines { +export interface ExtendedDatabaseBlobAuditingPolicies { /** - * Gets a database's vulnerability assessment rule baseline. + * Gets an extended 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 @@ -16611,10 +16410,7 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @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} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16623,14 +16419,14 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @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, ruleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's vulnerability assessment rule baseline. + * Gets an extended 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 @@ -16638,10 +16434,7 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @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} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16655,7 +16448,7 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * {Promise} A promise is returned. * - * @resolve {DatabaseVulnerabilityAssessmentRuleBaseline} - The deserialized result object. + * @resolve {ExtendedDatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16663,21 +16456,21 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * {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. + * {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. */ - 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; + 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 vulnerability assessment rule baseline. + * Creates or updates an extended 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 @@ -16685,14 +16478,106 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @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} databaseName The name of the database. * - * @param {string} ruleId The vulnerability assessment rule ID. + * @param {object} parameters The extended database blob auditing policy. * - * @param {object} parameters The requested rule baseline resource. + * @param {string} [parameters.predicateExpression] Specifies condition of + * where clause when creating an audit. * - * @param {array} parameters.baselineResults The rule baseline result + * @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. * @@ -16701,14 +16586,14 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @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, ruleId: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExtendedDatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's vulnerability assessment rule baseline. + * Creates or updates an extended 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 @@ -16716,88 +16601,106 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * @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} databaseName The name of the database. * - * @param {object} parameters The requested rule baseline resource. + * @param {object} parameters The extended database blob auditing policy. * - * @param {array} parameters.baselineResults The rule baseline result + * @param {string} [parameters.predicateExpression] Specifies condition of + * where clause when creating an audit. * - * @param {object} [options] Optional Parameters. + * @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 {object} [options.customHeaders] Headers that will be added to the - * request + * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. * - * @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. - */ - 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; - - - /** - * Removes the 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 {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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Removes the 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 {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. * - * @param {string} serverName The name of the server. + * @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} databaseName The name of the database for which the - * vulnerability assessment rule baseline is defined. + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. * - * @param {string} ruleId The vulnerability assessment rule ID. + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage's secondary key. * * @param {object} [options] Optional Parameters. * @@ -16811,7 +16714,7 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExtendedDatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16819,28 +16722,30 @@ export interface DatabaseVulnerabilityAssessmentRuleBaselines { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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 - * DatabaseVulnerabilityAssessments + * ExtendedServerBlobAuditingPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DatabaseVulnerabilityAssessments { +export interface ExtendedServerBlobAuditingPolicies { /** - * Gets the database's vulnerability assessment. + * 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 @@ -16848,9 +16753,6 @@ export interface DatabaseVulnerabilityAssessments { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which the - * vulnerability assessment is defined. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16858,14 +16760,14 @@ export interface DatabaseVulnerabilityAssessments { * * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the database's vulnerability assessment. + * 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 @@ -16873,9 +16775,6 @@ export interface DatabaseVulnerabilityAssessments { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which the - * vulnerability assessment is defined. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -16888,7 +16787,7 @@ export interface DatabaseVulnerabilityAssessments { * * {Promise} A promise is returned. * - * @resolve {DatabaseVulnerabilityAssessment} - The deserialized result object. + * @resolve {ExtendedServerBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16896,21 +16795,21 @@ export interface DatabaseVulnerabilityAssessments { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseVulnerabilityAssessment} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseVulnerabilityAssessment} for more + * {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, 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, 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 the database's vulnerability assessment. + * 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 @@ -16918,30 +16817,104 @@ export interface DatabaseVulnerabilityAssessments { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which the - * vulnerability assessment is defined. + * @param {object} parameters Properties of extended blob auditing policy * - * @param {object} parameters The requested resource. + * @param {string} [parameters.predicateExpression] Specifies condition of + * where clause when creating an audit. * - * @param {string} parameters.storageContainerPath A blob storage container - * path to hold the scan results (e.g. - * https://myStorage.blob.core.windows.net/VaScans/). + * @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.storageContainerSasKey A shared access signature - * (SAS Key) that has write access to the blob container specified in - * 'storageContainerPath' parameter. + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. * - * @param {object} [parameters.recurringScans] The recurring scans settings + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. * - * @param {boolean} [parameters.recurringScans.isEnabled] Recurring scans - * state. + * @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 {boolean} [parameters.recurringScans.emailSubscriptionAdmins] - * Specifies that the schedule scan notification will be is sent to the - * subscription administrators. + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. * - * @param {array} [parameters.recurringScans.emails] Specifies an array of - * e-mail addresses to which the scan notification is sent. + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage's secondary key. * * @param {object} [options] Optional Parameters. * @@ -16950,14 +16923,14 @@ export interface DatabaseVulnerabilityAssessments { * * @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.DatabaseVulnerabilityAssessment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates the database's vulnerability assessment. + * 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 @@ -16965,30 +16938,104 @@ export interface DatabaseVulnerabilityAssessments { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which the - * vulnerability assessment is defined. + * @param {object} parameters Properties of extended blob auditing policy * - * @param {object} parameters The requested resource. + * @param {string} [parameters.predicateExpression] Specifies condition of + * where clause when creating an audit. * - * @param {string} parameters.storageContainerPath A blob storage container - * path to hold the scan results (e.g. - * https://myStorage.blob.core.windows.net/VaScans/). + * @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.storageContainerSasKey A shared access signature - * (SAS Key) that has write access to the blob container specified in - * 'storageContainerPath' parameter. + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. * - * @param {object} [parameters.recurringScans] The recurring scans settings + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. * - * @param {boolean} [parameters.recurringScans.isEnabled] Recurring scans - * state. + * @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 {boolean} [parameters.recurringScans.emailSubscriptionAdmins] - * Specifies that the schedule scan notification will be is sent to the - * subscription administrators. + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. * - * @param {array} [parameters.recurringScans.emails] Specifies an array of - * e-mail addresses to which the scan notification is sent. + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage's secondary key. * * @param {object} [options] Optional Parameters. * @@ -17002,7 +17049,7 @@ export interface DatabaseVulnerabilityAssessments { * * {Promise} A promise is returned. * - * @resolve {DatabaseVulnerabilityAssessment} - The deserialized result object. + * @resolve {ExtendedServerBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17010,21 +17057,21 @@ export interface DatabaseVulnerabilityAssessments { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseVulnerabilityAssessment} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseVulnerabilityAssessment} for more + * {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, databaseName: string, parameters: models.DatabaseVulnerabilityAssessment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseVulnerabilityAssessment, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseVulnerabilityAssessment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Removes the database's vulnerability assessment. + * 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 @@ -17032,8 +17079,104 @@ export interface DatabaseVulnerabilityAssessments { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which the - * vulnerability assessment is defined. + * @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. * @@ -17042,14 +17185,14 @@ export interface DatabaseVulnerabilityAssessments { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ExtendedServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Removes the database's vulnerability assessment. + * 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 @@ -17057,8 +17200,104 @@ export interface DatabaseVulnerabilityAssessments { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database for which the - * vulnerability assessment is defined. + * @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. * @@ -17072,7 +17311,7 @@ export interface DatabaseVulnerabilityAssessments { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ExtendedServerBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17080,28 +17319,30 @@ export interface DatabaseVulnerabilityAssessments { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 - * JobAgents + * ServerBlobAuditingPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface JobAgents { +export interface ServerBlobAuditingPolicies { /** - * Gets a list of job agents in a server. + * 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 @@ -17116,14 +17357,14 @@ export interface JobAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of job agents in a server. + * 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 @@ -17143,7 +17384,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {JobAgentListResult} - The deserialized result object. + * @resolve {ServerBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17151,20 +17392,21 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobAgentListResult} for more information. + * {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. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Gets a job agent. + * 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 @@ -17172,7 +17414,101 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be retrieved. + * @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. * @@ -17181,14 +17517,14 @@ export interface JobAgents { * * @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, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a job agent. + * 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 @@ -17196,11 +17532,105 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be retrieved. + * @param {object} parameters Properties of blob auditing policy * - * @param {object} [options] Optional Parameters. + * @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 {object} [options.customHeaders] Headers that will be added to the + * @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. @@ -17210,7 +17640,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {JobAgent} - The deserialized result object. + * @resolve {ServerBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17218,20 +17648,21 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobAgent} [result] - The deserialized result object if an error did not occur. - * See {@link JobAgent} for more information. + * {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, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 job agent. + * 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 @@ -17239,37 +17670,101 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be created or - * updated. - * - * @param {object} parameters The requested job agent resource state. - * - * @param {object} [parameters.sku] The name and tier of the SKU. - * - * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is - * typically a letter+number code + * @param {object} parameters Properties of blob auditing policy * - * @param {string} [parameters.sku.tier] This field is required to be - * implemented by the Resource Provider if the service has more than one tier, - * but is not required on a PUT. + * @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.sku.size] The SKU size. When the name field is - * the combination of tier and some other value, this would be the standalone - * code. + * @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.sku.family] If the service has different - * generations of hardware, for the same SKU, then that can be captured here. + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. * - * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in - * then the capacity integer should be included. If scale out/in is not - * possible for the resource this may be omitted. + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. * - * @param {string} parameters.databaseId Resource ID of the database to store - * job metadata in. + * @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} parameters.location Resource location. + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. * - * @param {object} [parameters.tags] Resource tags. + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage's secondary key. * * @param {object} [options] Optional Parameters. * @@ -17278,14 +17773,14 @@ export interface JobAgents { * * @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, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a job agent. + * 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 @@ -17293,37 +17788,101 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be created or - * updated. - * - * @param {object} parameters The requested job agent resource state. - * - * @param {object} [parameters.sku] The name and tier of the SKU. - * - * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is - * typically a letter+number code + * @param {object} parameters Properties of blob auditing policy * - * @param {string} [parameters.sku.tier] This field is required to be - * implemented by the Resource Provider if the service has more than one tier, - * but is not required on a PUT. + * @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.sku.size] The SKU size. When the name field is - * the combination of tier and some other value, this would be the standalone - * code. + * @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.sku.family] If the service has different - * generations of hardware, for the same SKU, then that can be captured here. + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. * - * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in - * then the capacity integer should be included. If scale out/in is not - * possible for the resource this may be omitted. + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. * - * @param {string} parameters.databaseId Resource ID of the database to store - * job metadata in. + * @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} parameters.location Resource location. + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. * - * @param {object} [parameters.tags] Resource tags. + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage's secondary key. * * @param {object} [options] Optional Parameters. * @@ -17337,7 +17896,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {JobAgent} - The deserialized result object. + * @resolve {ServerBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17345,20 +17904,30 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobAgent} [result] - The deserialized result object if an error did not occur. - * See {@link JobAgent} for more information. + * {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, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 { /** - * Deletes a job agent. + * 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 @@ -17366,7 +17935,7 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -17375,14 +17944,14 @@ export interface JobAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a job agent. + * 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 @@ -17390,7 +17959,7 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be deleted. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -17404,7 +17973,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17412,19 +17981,21 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Updates a job agent. + * 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 @@ -17432,11 +18003,103 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be updated. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The update to the job agent. + * @param {object} parameters The database blob auditing policy. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -17445,14 +18108,14 @@ export interface JobAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a job agent. + * 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 @@ -17460,11 +18123,103 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be updated. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The update to the job agent. + * @param {object} parameters The database blob auditing policy. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -17478,7 +18233,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {JobAgent} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17486,20 +18241,30 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobAgent} [result] - The deserialized result object if an error did not occur. - * See {@link JobAgent} for more information. + * {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. */ - update(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 { /** - * Creates or updates a job agent. + * 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 @@ -17507,53 +18272,30 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be created or - * updated. - * - * @param {object} parameters The requested job agent resource state. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. * - * @param {object} [parameters.sku] The name and tier of the SKU. + * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is - * typically a letter+number code + * @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 {string} [parameters.sku.tier] This field is required to be - * implemented by the Resource Provider if the service has more than one tier, - * but is not required on a PUT. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.sku.size] The SKU size. When the name field is - * the combination of tier and some other value, this would be the standalone - * code. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.sku.family] If the service has different - * generations of hardware, for the same SKU, then that can be captured here. + * @returns {Promise} A promise is returned * - * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in - * then the capacity integer should be included. If scale out/in is not - * possible for the resource this may be omitted. - * - * @param {string} parameters.databaseId Resource ID of the database to store - * job metadata in. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a job agent. + * 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 @@ -17561,37 +18303,14 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be created or - * updated. - * - * @param {object} parameters The requested job agent resource state. - * - * @param {object} [parameters.sku] The name and tier of the SKU. - * - * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is - * typically a letter+number code - * - * @param {string} [parameters.sku.tier] This field is required to be - * implemented by the Resource Provider if the service has more than one tier, - * but is not required on a PUT. - * - * @param {string} [parameters.sku.size] The SKU size. When the name field is - * the combination of tier and some other value, this would be the standalone - * code. - * - * @param {string} [parameters.sku.family] If the service has different - * generations of hardware, for the same SKU, then that can be captured here. - * - * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in - * then the capacity integer should be included. If scale out/in is not - * possible for the resource this may be omitted. - * - * @param {string} parameters.databaseId Resource ID of the database to store - * job metadata in. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. * - * @param {string} parameters.location Resource location. + * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -17605,7 +18324,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {JobAgent} - The deserialized result object. + * @resolve {DatabaseVulnerabilityAssessmentRuleBaseline} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17613,20 +18332,21 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobAgent} [result] - The deserialized result object if an error did not occur. - * See {@link JobAgent} 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. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Deletes a job agent. + * 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 @@ -17634,7 +18354,18 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be deleted. + * @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. * @@ -17643,14 +18374,14 @@ export interface JobAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, parameters: models.DatabaseVulnerabilityAssessmentRuleBaseline, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a job agent. + * 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 @@ -17658,7 +18389,18 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be deleted. + * @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. * @@ -17672,7 +18414,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseVulnerabilityAssessmentRuleBaseline} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17680,19 +18422,21 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Updates a job agent. + * Removes the 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 @@ -17700,11 +18444,14 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be updated. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. * - * @param {object} parameters The update to the job agent. + * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -17713,14 +18460,14 @@ export interface JobAgents { * * @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, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, ruleId: string, baselineName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a job agent. + * Removes the 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 @@ -17728,11 +18475,14 @@ export interface JobAgents { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent to be updated. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment rule baseline is defined. * - * @param {object} parameters The update to the job agent. + * @param {string} ruleId The vulnerability assessment rule ID. * - * @param {object} [parameters.tags] Resource tags. + * @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. * @@ -17746,7 +18496,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {JobAgent} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17754,23 +18504,37 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobAgent} [result] - The deserialized result object if an error did not occur. - * See {@link JobAgent} 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, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; +} + +/** + * @class + * DatabaseVulnerabilityAssessments + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseVulnerabilityAssessments { /** - * Gets a list of job agents in a server. + * Gets the database's vulnerability assessment. * - * @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 {string} databaseName The name of the database for which the + * vulnerability assessment is defined. * * @param {object} [options] Optional Parameters. * @@ -17779,17 +18543,23 @@ export interface JobAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of job agents in a server. + * Gets the database's vulnerability assessment. * - * @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 {string} databaseName The name of the database for which the + * vulnerability assessment is defined. * * @param {object} [options] Optional Parameters. * @@ -17803,7 +18573,7 @@ export interface JobAgents { * * {Promise} A promise is returned. * - * @resolve {JobAgentListResult} - The deserialized result object. + * @resolve {DatabaseVulnerabilityAssessment} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17811,29 +18581,21 @@ export interface JobAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobAgentListResult} for more information. + * {DatabaseVulnerabilityAssessment} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseVulnerabilityAssessment} 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 - * JobCredentials - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface JobCredentials { + 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; /** - * Gets a list of jobs credentials. + * Creates or updates the database's vulnerability assessment. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -17841,7 +18603,35 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment is defined. + * + * @param {object} parameters The requested resource. + * + * @param {string} parameters.storageContainerPath A blob storage container + * path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * + * @param {string} [parameters.storageContainerSasKey] A shared access + * signature (SAS Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If 'StorageContainerSasKey' + * isn't specified, storageAccountAccessKey is required. + * + * @param {object} [parameters.recurringScans] The recurring scans settings + * + * @param {boolean} [parameters.recurringScans.isEnabled] Recurring scans + * state. + * + * @param {boolean} [parameters.recurringScans.emailSubscriptionAdmins] + * Specifies that the schedule scan notification will be is sent to the + * subscription administrators. + * + * @param {array} [parameters.recurringScans.emails] Specifies an array of + * e-mail addresses to which the scan notification is sent. * * @param {object} [options] Optional Parameters. * @@ -17850,14 +18640,14 @@ export interface JobCredentials { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseVulnerabilityAssessment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of jobs credentials. + * Creates or updates the database's vulnerability assessment. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -17865,7 +18655,35 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment is defined. + * + * @param {object} parameters The requested resource. + * + * @param {string} parameters.storageContainerPath A blob storage container + * path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * + * @param {string} [parameters.storageContainerSasKey] A shared access + * signature (SAS Key) that has write access to the blob container specified in + * 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If 'StorageContainerSasKey' + * isn't specified, storageAccountAccessKey is required. + * + * @param {object} [parameters.recurringScans] The recurring scans settings + * + * @param {boolean} [parameters.recurringScans.isEnabled] Recurring scans + * state. + * + * @param {boolean} [parameters.recurringScans.emailSubscriptionAdmins] + * Specifies that the schedule scan notification will be is sent to the + * subscription administrators. + * + * @param {array} [parameters.recurringScans.emails] Specifies an array of + * e-mail addresses to which the scan notification is sent. * * @param {object} [options] Optional Parameters. * @@ -17879,7 +18697,7 @@ export interface JobCredentials { * * {Promise} A promise is returned. * - * @resolve {JobCredentialListResult} - The deserialized result object. + * @resolve {DatabaseVulnerabilityAssessment} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17887,21 +18705,21 @@ export interface JobCredentials { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobCredentialListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobCredentialListResult} for more + * {DatabaseVulnerabilityAssessment} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseVulnerabilityAssessment} 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. */ - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseVulnerabilityAssessment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseVulnerabilityAssessment, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseVulnerabilityAssessment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a jobs credential. + * Removes the database's vulnerability assessment. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -17909,9 +18727,8 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} credentialName The name of the credential. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment is defined. * * @param {object} [options] Optional Parameters. * @@ -17920,14 +18737,14 @@ export interface JobCredentials { * * @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, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a jobs credential. + * Removes the database's vulnerability assessment. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -17935,9 +18752,8 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} credentialName The name of the credential. + * @param {string} databaseName The name of the database for which the + * vulnerability assessment is defined. * * @param {object} [options] Optional Parameters. * @@ -17951,7 +18767,7 @@ export interface JobCredentials { * * {Promise} A promise is returned. * - * @resolve {JobCredential} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17959,20 +18775,28 @@ export interface JobCredentials { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobCredential} [result] - The deserialized result object if an error did not occur. - * See {@link JobCredential} 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. */ - get(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * JobAgents + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface JobAgents { /** - * Creates or updates a job credential. + * Gets a list of job agents in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -17980,16 +18804,6 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} credentialName The name of the credential. - * - * @param {object} parameters The requested job credential state. - * - * @param {string} parameters.username The credential user name. - * - * @param {string} parameters.password The credential password. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -17997,14 +18811,14 @@ export interface JobCredentials { * * @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, jobAgentName: string, credentialName: string, parameters: models.JobCredential, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a job credential. + * Gets a list of job agents in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18012,16 +18826,6 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} credentialName The name of the credential. - * - * @param {object} parameters The requested job credential state. - * - * @param {string} parameters.username The credential user name. - * - * @param {string} parameters.password The credential password. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -18034,7 +18838,7 @@ export interface JobCredentials { * * {Promise} A promise is returned. * - * @resolve {JobCredential} - The deserialized result object. + * @resolve {JobAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18042,20 +18846,20 @@ export interface JobCredentials { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobCredential} [result] - The deserialized result object if an error did not occur. - * See {@link JobCredential} for more information. + * {JobAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobAgentListResult} 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, jobAgentName: string, credentialName: string, parameters: models.JobCredential, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, parameters: models.JobCredential, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, parameters: models.JobCredential, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a job credential. + * Gets a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18063,9 +18867,7 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} credentialName The name of the credential. + * @param {string} jobAgentName The name of the job agent to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -18074,14 +18876,14 @@ export interface JobCredentials { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a job credential. + * Gets a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18089,9 +18891,7 @@ export interface JobCredentials { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} credentialName The name of the credential. + * @param {string} jobAgentName The name of the job agent to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -18105,7 +18905,7 @@ export interface JobCredentials { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {JobAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18113,22 +18913,58 @@ export interface JobCredentials { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {JobAgent} [result] - The deserialized result object if an error did not occur. + * See {@link JobAgent} 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. */ - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of jobs credentials. + * Creates or updates a job agent. * - * @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 {string} jobAgentName The name of the job agent to be created or + * updated. + * + * @param {object} parameters The requested job agent resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is + * typically a letter+number code + * + * @param {string} [parameters.sku.tier] This field is required to be + * implemented by the Resource Provider if the service has more than one tier, + * but is not required on a PUT. + * + * @param {string} [parameters.sku.size] The SKU size. When the name field is + * the combination of tier and some other value, this would be the standalone + * code. + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in + * then the capacity integer should be included. If scale out/in is not + * possible for the resource this may be omitted. + * + * @param {string} parameters.databaseId Resource ID of the database to store + * job metadata in. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18137,17 +18973,52 @@ export interface JobCredentials { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of jobs credentials. + * Creates or updates a job agent. * - * @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 {string} jobAgentName The name of the job agent to be created or + * updated. + * + * @param {object} parameters The requested job agent resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is + * typically a letter+number code + * + * @param {string} [parameters.sku.tier] This field is required to be + * implemented by the Resource Provider if the service has more than one tier, + * but is not required on a PUT. + * + * @param {string} [parameters.sku.size] The SKU size. When the name field is + * the combination of tier and some other value, this would be the standalone + * code. + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in + * then the capacity integer should be included. If scale out/in is not + * possible for the resource this may be omitted. + * + * @param {string} parameters.databaseId Resource ID of the database to store + * job metadata in. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18161,7 +19032,7 @@ export interface JobCredentials { * * {Promise} A promise is returned. * - * @resolve {JobCredentialListResult} - The deserialized result object. + * @resolve {JobAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18169,30 +19040,20 @@ export interface JobCredentials { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobCredentialListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobCredentialListResult} for more - * information. + * {JobAgent} [result] - The deserialized result object if an error did not occur. + * See {@link JobAgent} 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. */ - listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; - listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * JobExecutions - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface JobExecutions { + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all executions in a job agent. + * Deletes a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18200,44 +19061,23 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be deleted. * * @param {object} [options] Optional Parameters. * - * @param {date} [options.createTimeMin] If specified, only job executions - * created at or after the specified time are included. - * - * @param {date} [options.createTimeMax] If specified, only job executions - * created before the specified time are included. - * - * @param {date} [options.endTimeMin] If specified, only job executions - * completed at or after the specified time are included. - * - * @param {date} [options.endTimeMax] If specified, only job executions - * completed before the specified time are included. - * - * @param {boolean} [options.isActive] If specified, only active or only - * completed job executions are included. - * - * @param {number} [options.skip] The number of elements in the collection to - * skip. - * - * @param {number} [options.top] The number of elements to return from the - * collection. - * * @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. */ - listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all executions in a job agent. + * Deletes a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18245,42 +19085,21 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be deleted. * * @param {object} [options] Optional Parameters. * - * @param {date} [options.createTimeMin] If specified, only job executions - * created at or after the specified time are included. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {date} [options.createTimeMax] If specified, only job executions - * created before the specified time are included. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {date} [options.endTimeMin] If specified, only job executions - * completed at or after the specified time are included. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {date} [options.endTimeMax] If specified, only job executions - * completed before the specified time are included. + * {Promise} A promise is returned. * - * @param {boolean} [options.isActive] If specified, only active or only - * completed job executions are included. - * - * @param {number} [options.skip] The number of elements in the collection to - * skip. - * - * @param {number} [options.top] The number of elements to return from the - * collection. - * - * @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 {JobExecutionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18288,21 +19107,19 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} 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. */ - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Requests cancellation of a job execution. + * Updates a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18310,11 +19127,11 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be updated. * - * @param {string} jobName The name of the job. + * @param {object} parameters The update to the job agent. * - * @param {uuid} jobExecutionId The id of the job execution to cancel. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18323,14 +19140,14 @@ export interface JobExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Requests cancellation of a job execution. + * Updates a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18338,11 +19155,11 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be updated. * - * @param {string} jobName The name of the job. + * @param {object} parameters The update to the job agent. * - * @param {uuid} jobExecutionId The id of the job execution to cancel. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18356,7 +19173,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {JobAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18364,19 +19181,20 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {JobAgent} [result] - The deserialized result object if an error did not occur. + * See {@link JobAgent} 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. */ - cancel(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Starts an elastic job execution. + * Creates or updates a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18384,9 +19202,37 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be created or + * updated. * - * @param {string} jobName The name of the job to get. + * @param {object} parameters The requested job agent resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is + * typically a letter+number code + * + * @param {string} [parameters.sku.tier] This field is required to be + * implemented by the Resource Provider if the service has more than one tier, + * but is not required on a PUT. + * + * @param {string} [parameters.sku.size] The SKU size. When the name field is + * the combination of tier and some other value, this would be the standalone + * code. + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in + * then the capacity integer should be included. If scale out/in is not + * possible for the resource this may be omitted. + * + * @param {string} parameters.databaseId Resource ID of the database to store + * job metadata in. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18395,14 +19241,14 @@ export interface JobExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Starts an elastic job execution. + * Creates or updates a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18410,9 +19256,37 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be created or + * updated. * - * @param {string} jobName The name of the job to get. + * @param {object} parameters The requested job agent resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU. Ex - P3. It is + * typically a letter+number code + * + * @param {string} [parameters.sku.tier] This field is required to be + * implemented by the Resource Provider if the service has more than one tier, + * but is not required on a PUT. + * + * @param {string} [parameters.sku.size] The SKU size. When the name field is + * the combination of tier and some other value, this would be the standalone + * code. + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] If the SKU supports scale out/in + * then the capacity integer should be included. If scale out/in is not + * possible for the resource this may be omitted. + * + * @param {string} parameters.databaseId Resource ID of the database to store + * job metadata in. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18426,7 +19300,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecution} - The deserialized result object. + * @resolve {JobAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18434,20 +19308,20 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecution} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecution} for more information. + * {JobAgent} [result] - The deserialized result object if an error did not occur. + * See {@link JobAgent} 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. */ - create(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; - create(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists a job's executions. + * Deletes a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18455,46 +19329,23 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} jobName The name of the job to get. + * @param {string} jobAgentName The name of the job agent to be deleted. * * @param {object} [options] Optional Parameters. * - * @param {date} [options.createTimeMin] If specified, only job executions - * created at or after the specified time are included. - * - * @param {date} [options.createTimeMax] If specified, only job executions - * created before the specified time are included. - * - * @param {date} [options.endTimeMin] If specified, only job executions - * completed at or after the specified time are included. - * - * @param {date} [options.endTimeMax] If specified, only job executions - * completed before the specified time are included. - * - * @param {boolean} [options.isActive] If specified, only active or only - * completed job executions are included. - * - * @param {number} [options.skip] The number of elements in the collection to - * skip. - * - * @param {number} [options.top] The number of elements to return from the - * collection. - * * @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. */ - listByJobWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists a job's executions. + * Deletes a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18502,33 +19353,10 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. - * - * @param {string} jobName The name of the job to get. + * @param {string} jobAgentName The name of the job agent to be deleted. * * @param {object} [options] Optional Parameters. * - * @param {date} [options.createTimeMin] If specified, only job executions - * created at or after the specified time are included. - * - * @param {date} [options.createTimeMax] If specified, only job executions - * created before the specified time are included. - * - * @param {date} [options.endTimeMin] If specified, only job executions - * completed at or after the specified time are included. - * - * @param {date} [options.endTimeMax] If specified, only job executions - * completed before the specified time are included. - * - * @param {boolean} [options.isActive] If specified, only active or only - * completed job executions are included. - * - * @param {number} [options.skip] The number of elements in the collection to - * skip. - * - * @param {number} [options.top] The number of elements to return from the - * collection. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -18539,7 +19367,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecutionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18547,21 +19375,19 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} 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. */ - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a job execution. + * Updates a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18569,11 +19395,11 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be updated. * - * @param {string} jobName The name of the job. + * @param {object} parameters The update to the job agent. * - * @param {uuid} jobExecutionId The id of the job execution + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18582,14 +19408,14 @@ export interface JobExecutions { * * @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, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a job execution. + * Updates a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18597,11 +19423,11 @@ export interface JobExecutions { * * @param {string} serverName The name of the server. * - * @param {string} jobAgentName The name of the job agent. + * @param {string} jobAgentName The name of the job agent to be updated. * - * @param {string} jobName The name of the job. + * @param {object} parameters The update to the job agent. * - * @param {uuid} jobExecutionId The id of the job execution + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -18615,7 +19441,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecution} - The deserialized result object. + * @resolve {JobAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18623,49 +19449,86 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecution} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecution} for more information. + * {JobAgent} [result] - The deserialized result object if an error did not occur. + * See {@link JobAgent} 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, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, parameters: models.JobAgentUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updatess a job execution. + * Gets a list of job agents in a 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} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} serverName The name of the server. + * @param {object} [options] Optional Parameters. * - * @param {string} jobAgentName The name of the job agent. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} jobName The name of the job to get. + * @returns {Promise} A promise is returned * - * @param {uuid} jobExecutionId The job execution id to create the job - * execution under. + * @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 job agents in 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 * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {Promise} A promise is returned. + * + * @resolve {JobAgentListResult} - 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. + * + * {JobAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobAgentListResult} 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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 + * JobCredentials + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface JobCredentials { + /** - * Creates or updatess a job execution. + * Gets a list of jobs credentials. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18675,10 +19538,29 @@ export interface JobExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. + * @param {object} [options] Optional Parameters. * - * @param {uuid} jobExecutionId The job execution id to create the job - * execution under. + * @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. + */ + listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of jobs credentials. + * + * @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} jobAgentName The name of the job agent. * * @param {object} [options] Optional Parameters. * @@ -18692,7 +19574,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecution} - The deserialized result object. + * @resolve {JobCredentialListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18700,20 +19582,21 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecution} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecution} for more information. + * {JobCredentialListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobCredentialListResult} 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, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Starts an elastic job execution. + * Gets a jobs credential. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18723,7 +19606,7 @@ export interface JobExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. + * @param {string} credentialName The name of the credential. * * @param {object} [options] Optional Parameters. * @@ -18732,14 +19615,14 @@ export interface JobExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Starts an elastic job execution. + * Gets a jobs credential. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18749,7 +19632,7 @@ export interface JobExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. + * @param {string} credentialName The name of the credential. * * @param {object} [options] Optional Parameters. * @@ -18763,7 +19646,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecution} - The deserialized result object. + * @resolve {JobCredential} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18771,20 +19654,20 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecution} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecution} for more information. + * {JobCredential} [result] - The deserialized result object if an error did not occur. + * See {@link JobCredential} 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. */ - beginCreate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updatess a job execution. + * Creates or updates a job credential. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18794,10 +19677,13 @@ export interface JobExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. + * @param {string} credentialName The name of the credential. * - * @param {uuid} jobExecutionId The job execution id to create the job - * execution under. + * @param {object} parameters The requested job credential state. + * + * @param {string} parameters.username The credential user name. + * + * @param {string} parameters.password The credential password. * * @param {object} [options] Optional Parameters. * @@ -18806,14 +19692,14 @@ export interface JobExecutions { * * @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, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, parameters: models.JobCredential, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updatess a job execution. + * Creates or updates a job credential. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18823,10 +19709,13 @@ export interface JobExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. + * @param {string} credentialName The name of the credential. * - * @param {uuid} jobExecutionId The job execution id to create the job - * execution under. + * @param {object} parameters The requested job credential state. + * + * @param {string} parameters.username The credential user name. + * + * @param {string} parameters.password The credential password. * * @param {object} [options] Optional Parameters. * @@ -18840,7 +19729,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecution} - The deserialized result object. + * @resolve {JobCredential} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18848,23 +19737,30 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecution} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecution} for more information. + * {JobCredential} [result] - The deserialized result object if an error did not occur. + * See {@link JobCredential} 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, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, parameters: models.JobCredential, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, parameters: models.JobCredential, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, parameters: models.JobCredential, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all executions in a job agent. + * Deletes a job credential. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} credentialName The name of the credential. * * @param {object} [options] Optional Parameters. * @@ -18873,17 +19769,24 @@ export interface JobExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all executions in a job agent. + * Deletes a job credential. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} credentialName The name of the credential. * * @param {object} [options] Optional Parameters. * @@ -18897,7 +19800,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecutionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18905,21 +19808,19 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} 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. */ - listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; - listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists a job's executions. + * Gets a list of jobs credentials. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -18931,14 +19832,14 @@ export interface JobExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists a job's executions. + * Gets a list of jobs credentials. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -18955,7 +19856,7 @@ export interface JobExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecutionListResult} - The deserialized result object. + * @resolve {JobCredentialListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18963,30 +19864,30 @@ export interface JobExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} for more + * {JobCredentialListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobCredentialListResult} 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. */ - listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobNext(nextPageLink: string, callback: ServiceCallback): void; - listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; + listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Jobs + * JobExecutions * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface Jobs { +export interface JobExecutions { /** - * Gets a list of jobs. + * Lists all executions in a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -18998,19 +19899,40 @@ export interface Jobs { * * @param {object} [options] Optional Parameters. * + * @param {date} [options.createTimeMin] If specified, only job executions + * created at or after the specified time are included. + * + * @param {date} [options.createTimeMax] If specified, only job executions + * created before the specified time are included. + * + * @param {date} [options.endTimeMin] If specified, only job executions + * completed at or after the specified time are included. + * + * @param {date} [options.endTimeMax] If specified, only job executions + * completed before the specified time are included. + * + * @param {boolean} [options.isActive] If specified, only active or only + * completed job executions are included. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {number} [options.top] The number of elements to return from the + * collection. + * * @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. */ - listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of jobs. + * Lists all executions in a job agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19022,76 +19944,26 @@ export interface Jobs { * * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {date} [options.createTimeMin] If specified, only job executions + * created at or after the specified time are included. * - * @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 {JobListResult} - 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. - * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} 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. - */ - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a job. - * - * @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} jobAgentName The name of the job agent. - * - * @param {string} jobName The name of the job to get. - * - * @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, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a job. + * @param {date} [options.createTimeMax] If specified, only job executions + * created before the specified time are included. * - * @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 {date} [options.endTimeMin] If specified, only job executions + * completed at or after the specified time are included. * - * @param {string} serverName The name of the server. + * @param {date} [options.endTimeMax] If specified, only job executions + * completed before the specified time are included. * - * @param {string} jobAgentName The name of the job agent. + * @param {boolean} [options.isActive] If specified, only active or only + * completed job executions are included. * - * @param {string} jobName The name of the job to get. + * @param {number} [options.skip] The number of elements in the collection to + * skip. * - * @param {object} [options] Optional Parameters. + * @param {number} [options.top] The number of elements to return from the + * collection. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -19103,7 +19975,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {Job} - The deserialized result object. + * @resolve {JobExecutionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19111,20 +19983,21 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} for more information. + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a job. + * Requests cancellation of a job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19134,28 +20007,9 @@ export interface Jobs { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. - * - * @param {object} parameters The requested job state. - * - * @param {string} [parameters.description] User-defined description of the - * job. - * - * @param {object} [parameters.schedule] Schedule properties of the job. - * - * @param {date} [parameters.schedule.startTime] Schedule start time. - * - * @param {date} [parameters.schedule.endTime] Schedule end time. - * - * @param {string} [parameters.schedule.type] Schedule interval type. Possible - * values include: 'Once', 'Recurring' - * - * @param {boolean} [parameters.schedule.enabled] Whether or not the schedule - * is enabled. + * @param {string} jobName The name of the job. * - * @param {string} [parameters.schedule.interval] Value of the schedule's - * recurring interval, if the scheduletype is recurring. ISO8601 duration - * format. + * @param {uuid} jobExecutionId The id of the job execution to cancel. * * @param {object} [options] Optional Parameters. * @@ -19164,14 +20018,14 @@ export interface Jobs { * * @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, jobAgentName: string, jobName: string, parameters: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a job. + * Requests cancellation of a job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19181,28 +20035,9 @@ export interface Jobs { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. - * - * @param {object} parameters The requested job state. - * - * @param {string} [parameters.description] User-defined description of the - * job. - * - * @param {object} [parameters.schedule] Schedule properties of the job. - * - * @param {date} [parameters.schedule.startTime] Schedule start time. - * - * @param {date} [parameters.schedule.endTime] Schedule end time. - * - * @param {string} [parameters.schedule.type] Schedule interval type. Possible - * values include: 'Once', 'Recurring' - * - * @param {boolean} [parameters.schedule.enabled] Whether or not the schedule - * is enabled. + * @param {string} jobName The name of the job. * - * @param {string} [parameters.schedule.interval] Value of the schedule's - * recurring interval, if the scheduletype is recurring. ISO8601 duration - * format. + * @param {uuid} jobExecutionId The id of the job execution to cancel. * * @param {object} [options] Optional Parameters. * @@ -19216,7 +20051,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {Job} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19224,20 +20059,19 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} 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. */ - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, parameters: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, parameters: models.Job, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, parameters: models.Job, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a job. + * Starts an elastic job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19247,7 +20081,7 @@ export interface Jobs { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to delete. + * @param {string} jobName The name of the job to get. * * @param {object} [options] Optional Parameters. * @@ -19256,14 +20090,14 @@ export interface Jobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a job. + * Starts an elastic job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19273,63 +20107,7 @@ export interface Jobs { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to delete. - * - * @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. - */ - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of jobs. - * - * @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|ServiceError} - The error object. - */ - listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of jobs. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} jobName The name of the job to get. * * @param {object} [options] Optional Parameters. * @@ -19343,7 +20121,7 @@ export interface Jobs { * * {Promise} A promise is returned. * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {JobExecution} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19351,29 +20129,20 @@ export interface Jobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} for more information. + * {JobExecution} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecution} 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. */ - listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; - listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * JobStepExecutions - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface JobStepExecutions { + create(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the step executions of a job execution. + * Lists a job's executions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19385,8 +20154,6 @@ export interface JobStepExecutions { * * @param {string} jobName The name of the job to get. * - * @param {uuid} jobExecutionId The id of the job execution - * * @param {object} [options] Optional Parameters. * * @param {date} [options.createTimeMin] If specified, only job executions @@ -19419,10 +20186,10 @@ export interface JobStepExecutions { * * @reject {Error|ServiceError} - The error object. */ - listByJobExecutionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByJobWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the step executions of a job execution. + * Lists a job's executions. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19434,8 +20201,6 @@ export interface JobStepExecutions { * * @param {string} jobName The name of the job to get. * - * @param {uuid} jobExecutionId The id of the job execution - * * @param {object} [options] Optional Parameters. * * @param {date} [options.createTimeMin] If specified, only job executions @@ -19485,13 +20250,13 @@ export interface JobStepExecutions { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; - listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a step execution of a job execution. + * Gets a job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19501,11 +20266,9 @@ export interface JobStepExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. - * - * @param {uuid} jobExecutionId The unique id of the job execution + * @param {string} jobName The name of the job. * - * @param {string} stepName The name of the step. + * @param {uuid} jobExecutionId The id of the job execution * * @param {object} [options] Optional Parameters. * @@ -19518,10 +20281,10 @@ export interface JobStepExecutions { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a step execution of a job execution. + * Gets a job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19531,11 +20294,9 @@ export interface JobStepExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. - * - * @param {uuid} jobExecutionId The unique id of the job execution + * @param {string} jobName The name of the job. * - * @param {string} stepName The name of the step. + * @param {uuid} jobExecutionId The id of the job execution * * @param {object} [options] Optional Parameters. * @@ -19564,16 +20325,26 @@ export interface JobStepExecutions { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the step executions of a job execution. + * Creates or updatess a job execution. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The job execution id to create the job + * execution under. * * @param {object} [options] Optional Parameters. * @@ -19582,17 +20353,27 @@ export interface JobStepExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByJobExecutionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the step executions of a job execution. + * Creates or updatess a job execution. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The job execution id to create the job + * execution under. * * @param {object} [options] Optional Parameters. * @@ -19606,7 +20387,7 @@ export interface JobStepExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecutionListResult} - The deserialized result object. + * @resolve {JobExecution} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19614,30 +20395,20 @@ export interface JobStepExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} for more - * information. + * {JobExecution} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecution} 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. */ - listByJobExecutionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobExecutionNext(nextPageLink: string, callback: ServiceCallback): void; - listByJobExecutionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * JobSteps - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface JobSteps { + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all job steps in the specified job version. + * Starts an elastic job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19649,8 +20420,6 @@ export interface JobSteps { * * @param {string} jobName The name of the job to get. * - * @param {number} jobVersion The version of the job to get. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -19658,14 +20427,14 @@ export interface JobSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByVersionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all job steps in the specified job version. + * Starts an elastic job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19677,8 +20446,6 @@ export interface JobSteps { * * @param {string} jobName The name of the job to get. * - * @param {number} jobVersion The version of the job to get. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -19691,7 +20458,7 @@ export interface JobSteps { * * {Promise} A promise is returned. * - * @resolve {JobStepListResult} - The deserialized result object. + * @resolve {JobExecution} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19699,20 +20466,20 @@ export interface JobSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStepListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobStepListResult} for more information. + * {JobExecution} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecution} 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. */ - listByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, callback: ServiceCallback): void; - listByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the specified version of a job step. + * Creates or updatess a job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19722,11 +20489,10 @@ export interface JobSteps { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job. - * - * @param {number} jobVersion The version of the job to get. + * @param {string} jobName The name of the job to get. * - * @param {string} stepName The name of the job step. + * @param {uuid} jobExecutionId The job execution id to create the job + * execution under. * * @param {object} [options] Optional Parameters. * @@ -19735,14 +20501,14 @@ export interface JobSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getByVersionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the specified version of a job step. + * Creates or updatess a job execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19752,11 +20518,10 @@ export interface JobSteps { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job. - * - * @param {number} jobVersion The version of the job to get. + * @param {string} jobName The name of the job to get. * - * @param {string} stepName The name of the job step. + * @param {uuid} jobExecutionId The job execution id to create the job + * execution under. * * @param {object} [options] Optional Parameters. * @@ -19770,7 +20535,7 @@ export interface JobSteps { * * {Promise} A promise is returned. * - * @resolve {JobStep} - The deserialized result object. + * @resolve {JobExecution} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19778,30 +20543,23 @@ export interface JobSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStep} [result] - The deserialized result object if an error did not occur. - * See {@link JobStep} for more information. + * {JobExecution} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecution} 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. */ - getByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, callback: ServiceCallback): void; - getByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all job steps for a job's current version. - * - * @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} jobAgentName The name of the job agent. + * Lists all executions in a job agent. * - * @param {string} jobName The name of the job to get. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -19810,24 +20568,17 @@ export interface JobSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByJobWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all job steps for a job's current version. - * - * @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} jobAgentName The name of the job agent. + * Lists all executions in a job agent. * - * @param {string} jobName The name of the job to get. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -19841,7 +20592,7 @@ export interface JobSteps { * * {Promise} A promise is returned. * - * @resolve {JobStepListResult} - The deserialized result object. + * @resolve {JobExecutionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19849,32 +20600,24 @@ export interface JobSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStepListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobStepListResult} for more information. + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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. */ - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; + listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a job step in a job's current version. - * - * @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} jobAgentName The name of the job agent. - * - * @param {string} jobName The name of the job. + * Lists a job's executions. * - * @param {string} stepName The name of the job step. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -19883,26 +20626,17 @@ export interface JobSteps { * * @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, jobAgentName: string, jobName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a job step in a job's current version. - * - * @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} jobAgentName The name of the job agent. - * - * @param {string} jobName The name of the job. + * Lists a job's executions. * - * @param {string} stepName The name of the job step. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -19916,7 +20650,7 @@ export interface JobSteps { * * {Promise} A promise is returned. * - * @resolve {JobStep} - The deserialized result object. + * @resolve {JobExecutionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -19924,21 +20658,30 @@ export interface JobSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStep} [result] - The deserialized result object if an error did not occur. - * See {@link JobStep} for more information. + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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, jobAgentName: string, jobName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, stepName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobNext(nextPageLink: string, callback: ServiceCallback): void; + listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Jobs + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Jobs { /** - * Creates or updates a job step. This will implicitly create a new job - * version. + * Gets a list of jobs. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -19948,19 +20691,971 @@ export interface JobSteps { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job. - * - * @param {string} stepName The name of the job step. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The requested state of the job step. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {number} [parameters.stepId] The job step's index within the job. If - * not specified when creating the job step, it will be created as the last - * step. If not specified when updating the job step, the step id is not - * modified. + * @returns {Promise} A promise is returned * - * @param {string} parameters.targetGroup The resource ID of the target group - * that the job step will be executed on. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of jobs. + * + * @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} jobAgentName The name of the job agent. + * + * @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 {JobListResult} - 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. + * + * {JobListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobListResult} 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. + */ + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a job. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @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, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a job. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @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 {Job} - 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. + * + * {Job} [result] - The deserialized result object if an error did not occur. + * See {@link Job} 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, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a job. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {object} parameters The requested job state. + * + * @param {string} [parameters.description] User-defined description of the + * job. + * + * @param {object} [parameters.schedule] Schedule properties of the job. + * + * @param {date} [parameters.schedule.startTime] Schedule start time. + * + * @param {date} [parameters.schedule.endTime] Schedule end time. + * + * @param {string} [parameters.schedule.type] Schedule interval type. Possible + * values include: 'Once', 'Recurring' + * + * @param {boolean} [parameters.schedule.enabled] Whether or not the schedule + * is enabled. + * + * @param {string} [parameters.schedule.interval] Value of the schedule's + * recurring interval, if the scheduletype is recurring. ISO8601 duration + * format. + * + * @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, jobAgentName: string, jobName: string, parameters: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a job. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {object} parameters The requested job state. + * + * @param {string} [parameters.description] User-defined description of the + * job. + * + * @param {object} [parameters.schedule] Schedule properties of the job. + * + * @param {date} [parameters.schedule.startTime] Schedule start time. + * + * @param {date} [parameters.schedule.endTime] Schedule end time. + * + * @param {string} [parameters.schedule.type] Schedule interval type. Possible + * values include: 'Once', 'Recurring' + * + * @param {boolean} [parameters.schedule.enabled] Whether or not the schedule + * is enabled. + * + * @param {string} [parameters.schedule.interval] Value of the schedule's + * recurring interval, if the scheduletype is recurring. ISO8601 duration + * format. + * + * @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 {Job} - 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. + * + * {Job} [result] - The deserialized result object if an error did not occur. + * See {@link Job} 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, jobAgentName: string, jobName: string, parameters: models.Job, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, parameters: models.Job, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, parameters: models.Job, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a job. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to delete. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a job. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to delete. + * + * @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. + */ + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of jobs. + * + * @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|ServiceError} - The error object. + */ + listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of jobs. + * + * @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 {JobListResult} - 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. + * + * {JobListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobListResult} 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. + */ + listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; + listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * JobStepExecutions + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface JobStepExecutions { + + + /** + * Lists the step executions of a job execution. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The id of the job execution + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.createTimeMin] If specified, only job executions + * created at or after the specified time are included. + * + * @param {date} [options.createTimeMax] If specified, only job executions + * created before the specified time are included. + * + * @param {date} [options.endTimeMin] If specified, only job executions + * completed at or after the specified time are included. + * + * @param {date} [options.endTimeMax] If specified, only job executions + * completed before the specified time are included. + * + * @param {boolean} [options.isActive] If specified, only active or only + * completed job executions are included. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {number} [options.top] The number of elements to return from the + * collection. + * + * @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. + */ + listByJobExecutionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the step executions of a job execution. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The id of the job execution + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.createTimeMin] If specified, only job executions + * created at or after the specified time are included. + * + * @param {date} [options.createTimeMax] If specified, only job executions + * created before the specified time are included. + * + * @param {date} [options.endTimeMin] If specified, only job executions + * completed at or after the specified time are included. + * + * @param {date} [options.endTimeMax] If specified, only job executions + * completed before the specified time are included. + * + * @param {boolean} [options.isActive] If specified, only active or only + * completed job executions are included. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {number} [options.top] The number of elements to return from the + * collection. + * + * @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 {JobExecutionListResult} - 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. + * + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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. + */ + listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; + listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a step execution of a job execution. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The unique id of the job execution + * + * @param {string} stepName The name of the step. + * + * @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, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a step execution of a job execution. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The unique id of the job execution + * + * @param {string} stepName The name of the step. + * + * @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 {JobExecution} - 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. + * + * {JobExecution} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecution} 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, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the step executions of a job execution. + * + * @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|ServiceError} - The error object. + */ + listByJobExecutionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the step executions of a job execution. + * + * @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 {JobExecutionListResult} - 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. + * + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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. + */ + listByJobExecutionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobExecutionNext(nextPageLink: string, callback: ServiceCallback): void; + listByJobExecutionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * JobSteps + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface JobSteps { + + + /** + * Gets all job steps in the specified job version. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {number} jobVersion The version of the job to get. + * + * @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. + */ + listByVersionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all job steps in the specified job version. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {number} jobVersion The version of the job to get. + * + * @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 {JobStepListResult} - 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. + * + * {JobStepListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStepListResult} 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. + */ + listByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, callback: ServiceCallback): void; + listByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets the specified version of a job step. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job. + * + * @param {number} jobVersion The version of the job to get. + * + * @param {string} stepName The name of the job step. + * + * @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. + */ + getByVersionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the specified version of a job step. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job. + * + * @param {number} jobVersion The version of the job to get. + * + * @param {string} stepName The name of the job step. + * + * @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 {JobStep} - 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. + * + * {JobStep} [result] - The deserialized result object if an error did not occur. + * See {@link JobStep} 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. + */ + getByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, callback: ServiceCallback): void; + getByVersion(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all job steps for a job's current version. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @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. + */ + listByJobWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all job steps for a job's current version. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @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 {JobStepListResult} - 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. + * + * {JobStepListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStepListResult} 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. + */ + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a job step in a job's current version. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job. + * + * @param {string} stepName The name of the job step. + * + * @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, jobAgentName: string, jobName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a job step in a job's current version. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job. + * + * @param {string} stepName The name of the job step. + * + * @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 {JobStep} - 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. + * + * {JobStep} [result] - The deserialized result object if an error did not occur. + * See {@link JobStep} 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, jobAgentName: string, jobName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, stepName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a job step. This will implicitly create a new job + * version. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job. + * + * @param {string} stepName The name of the job step. + * + * @param {object} parameters The requested state of the job step. + * + * @param {number} [parameters.stepId] The job step's index within the job. If + * not specified when creating the job step, it will be created as the last + * step. If not specified when updating the job step, the step id is not + * modified. + * + * @param {string} parameters.targetGroup The resource ID of the target group + * that the job step will be executed on. * * @param {string} parameters.credential The resource ID of the job credential * that will be used to connect to the targets. @@ -20302,10 +21997,136 @@ export interface JobSteps { /** * Gets all job steps for a job's current version. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 {JobStepListResult} - 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. + * + * {JobStepListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStepListResult} 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. + */ + listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobNext(nextPageLink: string, callback: ServiceCallback): void; + listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * JobTargetExecutions + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface JobTargetExecutions { + + + /** + * Lists target executions for all steps of a job execution. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The id of the job execution + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.createTimeMin] If specified, only job executions + * created at or after the specified time are included. + * + * @param {date} [options.createTimeMax] If specified, only job executions + * created before the specified time are included. + * + * @param {date} [options.endTimeMin] If specified, only job executions + * completed at or after the specified time are included. + * + * @param {date} [options.endTimeMax] If specified, only job executions + * completed before the specified time are included. + * + * @param {boolean} [options.isActive] If specified, only active or only + * completed job executions are included. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. + * + * @param {number} [options.top] The number of elements to return from the + * collection. + * + * @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. + */ + listByJobExecutionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists target executions for all steps of a job execution. + * + * @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} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The id of the job execution + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.createTimeMin] If specified, only job executions + * created at or after the specified time are included. + * + * @param {date} [options.createTimeMax] If specified, only job executions + * created before the specified time are included. + * + * @param {date} [options.endTimeMin] If specified, only job executions + * completed at or after the specified time are included. + * + * @param {date} [options.endTimeMax] If specified, only job executions + * completed before the specified time are included. + * + * @param {boolean} [options.isActive] If specified, only active or only + * completed job executions are included. + * + * @param {number} [options.skip] The number of elements in the collection to + * skip. * - * @param {object} [options] Optional Parameters. + * @param {number} [options.top] The number of elements to return from the + * collection. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20317,7 +22138,7 @@ export interface JobSteps { * * {Promise} A promise is returned. * - * @resolve {JobStepListResult} - The deserialized result object. + * @resolve {JobExecutionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20325,29 +22146,21 @@ export interface JobSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStepListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobStepListResult} for more information. + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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. */ - listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobNext(nextPageLink: string, callback: ServiceCallback): void; - listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * JobTargetExecutions - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface JobTargetExecutions { + listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; + listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists target executions for all steps of a job execution. + * Lists the target executions of a job step execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20361,6 +22174,8 @@ export interface JobTargetExecutions { * * @param {uuid} jobExecutionId The id of the job execution * + * @param {string} stepName The name of the step. + * * @param {object} [options] Optional Parameters. * * @param {date} [options.createTimeMin] If specified, only job executions @@ -20393,10 +22208,10 @@ export interface JobTargetExecutions { * * @reject {Error|ServiceError} - The error object. */ - listByJobExecutionWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByStepWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists target executions for all steps of a job execution. + * Lists the target executions of a job step execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20410,6 +22225,8 @@ export interface JobTargetExecutions { * * @param {uuid} jobExecutionId The id of the job execution * + * @param {string} stepName The name of the step. + * * @param {object} [options] Optional Parameters. * * @param {date} [options.createTimeMin] If specified, only job executions @@ -20459,13 +22276,13 @@ export interface JobTargetExecutions { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, callback: ServiceCallback): void; - listByJobExecution(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByStep(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + listByStep(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, callback: ServiceCallback): void; + listByStep(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the target executions of a job step execution. + * Gets a target execution. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20477,32 +22294,83 @@ export interface JobTargetExecutions { * * @param {string} jobName The name of the job to get. * - * @param {uuid} jobExecutionId The id of the job execution + * @param {uuid} jobExecutionId The unique id of the job execution * * @param {string} stepName The name of the step. * + * @param {uuid} targetId The target id. + * * @param {object} [options] Optional Parameters. * - * @param {date} [options.createTimeMin] If specified, only job executions - * created at or after the specified time are included. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {date} [options.createTimeMax] If specified, only job executions - * created before the specified time are included. + * @returns {Promise} A promise is returned * - * @param {date} [options.endTimeMin] If specified, only job executions - * completed at or after the specified time are included. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {date} [options.endTimeMax] If specified, only job executions - * completed before the specified time are included. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a target execution. * - * @param {boolean} [options.isActive] If specified, only active or only - * completed job executions are included. + * @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 {number} [options.skip] The number of elements in the collection to - * skip. + * @param {string} serverName The name of the server. * - * @param {number} [options.top] The number of elements to return from the - * collection. + * @param {string} jobAgentName The name of the job agent. + * + * @param {string} jobName The name of the job to get. + * + * @param {uuid} jobExecutionId The unique id of the job execution + * + * @param {string} stepName The name of the step. + * + * @param {uuid} targetId The target id. + * + * @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 {JobExecution} - 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. + * + * {JobExecution} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecution} 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, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists target executions for all steps of a job execution. + * + * @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 @@ -20513,11 +22381,117 @@ export interface JobTargetExecutions { * * @reject {Error|ServiceError} - The error object. */ - listByStepWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByJobExecutionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists target executions for all steps of a job execution. + * + * @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 {JobExecutionListResult} - 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. + * + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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. + */ + listByJobExecutionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobExecutionNext(nextPageLink: string, callback: ServiceCallback): void; + listByJobExecutionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the target executions of a job step execution. + * + * @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|ServiceError} - The error object. + */ + listByStepNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists the target executions of a job step execution. * + * @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 {JobExecutionListResult} - 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. + * + * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobExecutionListResult} 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. + */ + listByStepNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByStepNext(nextPageLink: string, callback: ServiceCallback): void; + listByStepNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * JobTargetGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface JobTargetGroups { + + + /** + * Gets all target groups in an agent. + * * @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. @@ -20526,34 +22500,31 @@ export interface JobTargetExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. - * - * @param {uuid} jobExecutionId The id of the job execution - * - * @param {string} stepName The name of the step. - * * @param {object} [options] Optional Parameters. * - * @param {date} [options.createTimeMin] If specified, only job executions - * created at or after the specified time are included. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {date} [options.createTimeMax] If specified, only job executions - * created before the specified time are included. + * @returns {Promise} A promise is returned * - * @param {date} [options.endTimeMin] If specified, only job executions - * completed at or after the specified time are included. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all target groups in an agent. * - * @param {date} [options.endTimeMax] If specified, only job executions - * completed before the specified time are included. + * @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 {boolean} [options.isActive] If specified, only active or only - * completed job executions are included. + * @param {string} serverName The name of the server. * - * @param {number} [options.skip] The number of elements in the collection to - * skip. + * @param {string} jobAgentName The name of the job agent. * - * @param {number} [options.top] The number of elements to return from the - * collection. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -20565,7 +22536,7 @@ export interface JobTargetExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecutionListResult} - The deserialized result object. + * @resolve {JobTargetGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20573,21 +22544,21 @@ export interface JobTargetExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} for more + * {JobTargetGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobTargetGroupListResult} 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. */ - listByStep(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options?: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; - listByStep(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, callback: ServiceCallback): void; - listByStep(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, options: { createTimeMin? : Date, createTimeMax? : Date, endTimeMin? : Date, endTimeMax? : Date, isActive? : boolean, skip? : number, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; + listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a target execution. + * Gets a target group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20597,13 +22568,7 @@ export interface JobTargetExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. - * - * @param {uuid} jobExecutionId The unique id of the job execution - * - * @param {string} stepName The name of the step. - * - * @param {uuid} targetId The target id. + * @param {string} targetGroupName The name of the target group. * * @param {object} [options] Optional Parameters. * @@ -20612,14 +22577,14 @@ export interface JobTargetExecutions { * * @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, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a target execution. + * Gets a target group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20629,13 +22594,7 @@ export interface JobTargetExecutions { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} jobName The name of the job to get. - * - * @param {uuid} jobExecutionId The unique id of the job execution - * - * @param {string} stepName The name of the step. - * - * @param {uuid} targetId The target id. + * @param {string} targetGroupName The name of the target group. * * @param {object} [options] Optional Parameters. * @@ -20649,7 +22608,7 @@ export interface JobTargetExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecution} - The deserialized result object. + * @resolve {JobTargetGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20657,23 +22616,34 @@ export interface JobTargetExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecution} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecution} for more information. + * {JobTargetGroup} [result] - The deserialized result object if an error did not occur. + * See {@link JobTargetGroup} 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, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobExecutionId: string, stepName: string, targetId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists target executions for all steps of a job execution. + * Creates or updates a target group. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} targetGroupName The name of the target group. + * + * @param {object} parameters The requested state of the target group. + * + * @param {array} parameters.members Members of the target group. * * @param {object} [options] Optional Parameters. * @@ -20682,17 +22652,28 @@ export interface JobTargetExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByJobExecutionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists target executions for all steps of a job execution. + * Creates or updates a target group. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} targetGroupName The name of the target group. + * + * @param {object} parameters The requested state of the target group. + * + * @param {array} parameters.members Members of the target group. * * @param {object} [options] Optional Parameters. * @@ -20706,7 +22687,7 @@ export interface JobTargetExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecutionListResult} - The deserialized result object. + * @resolve {JobTargetGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20714,24 +22695,30 @@ export interface JobTargetExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} for more - * information. + * {JobTargetGroup} [result] - The deserialized result object if an error did not occur. + * See {@link JobTargetGroup} 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. */ - listByJobExecutionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobExecutionNext(nextPageLink: string, callback: ServiceCallback): void; - listByJobExecutionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the target executions of a job step execution. + * Deletes a target group. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} targetGroupName The name of the target group. * * @param {object} [options] Optional Parameters. * @@ -20740,17 +22727,24 @@ export interface JobTargetExecutions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByStepNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the target executions of a job step execution. + * Deletes a target group. * - * @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 {string} jobAgentName The name of the job agent. + * + * @param {string} targetGroupName The name of the target group. * * @param {object} [options] Optional Parameters. * @@ -20764,7 +22758,7 @@ export interface JobTargetExecutions { * * {Promise} A promise is returned. * - * @resolve {JobExecutionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20772,38 +22766,22 @@ export interface JobTargetExecutions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobExecutionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobExecutionListResult} 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. */ - listByStepNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByStepNext(nextPageLink: string, callback: ServiceCallback): void; - listByStepNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * JobTargetGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface JobTargetGroups { + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Gets all target groups in an agent. * - * @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} jobAgentName The name of the job agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -20816,18 +22794,13 @@ export interface JobTargetGroups { * * @reject {Error|ServiceError} - The error object. */ - listByAgentWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets all target groups in an agent. * - * @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} jobAgentName The name of the job agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -20857,13 +22830,22 @@ export interface JobTargetGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, callback: ServiceCallback): void; - listByAgent(resourceGroupName: string, serverName: string, jobAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; + listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * JobVersions + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface JobVersions { /** - * Gets a target group. + * Gets all versions of a job. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20873,7 +22855,7 @@ export interface JobTargetGroups { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} targetGroupName The name of the target group. + * @param {string} jobName The name of the job to get. * * @param {object} [options] Optional Parameters. * @@ -20882,14 +22864,14 @@ export interface JobTargetGroups { * * @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, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByJobWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a target group. + * Gets all versions of a job. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20899,7 +22881,7 @@ export interface JobTargetGroups { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} targetGroupName The name of the target group. + * @param {string} jobName The name of the job to get. * * @param {object} [options] Optional Parameters. * @@ -20913,7 +22895,7 @@ export interface JobTargetGroups { * * {Promise} A promise is returned. * - * @resolve {JobTargetGroup} - The deserialized result object. + * @resolve {JobVersionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20921,20 +22903,20 @@ export interface JobTargetGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobTargetGroup} [result] - The deserialized result object if an error did not occur. - * See {@link JobTargetGroup} for more information. + * {JobVersionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobVersionListResult} 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, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; + listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a target group. + * Gets a job version. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20944,11 +22926,9 @@ export interface JobTargetGroups { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} targetGroupName The name of the target group. - * - * @param {object} parameters The requested state of the target group. + * @param {string} jobName The name of the job. * - * @param {array} parameters.members Members of the target group. + * @param {number} jobVersion The version of the job to get. * * @param {object} [options] Optional Parameters. * @@ -20957,14 +22937,14 @@ export interface JobTargetGroups { * * @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, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a target group. + * Gets a job version. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -20974,11 +22954,9 @@ export interface JobTargetGroups { * * @param {string} jobAgentName The name of the job agent. * - * @param {string} targetGroupName The name of the target group. - * - * @param {object} parameters The requested state of the target group. + * @param {string} jobName The name of the job. * - * @param {array} parameters.members Members of the target group. + * @param {number} jobVersion The version of the job to get. * * @param {object} [options] Optional Parameters. * @@ -20992,7 +22970,7 @@ export interface JobTargetGroups { * * {Promise} A promise is returned. * - * @resolve {JobTargetGroup} - The deserialized result object. + * @resolve {JobVersion} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21000,30 +22978,23 @@ export interface JobTargetGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobTargetGroup} [result] - The deserialized result object if an error did not occur. - * See {@link JobTargetGroup} for more information. + * {JobVersion} [result] - The deserialized result object if an error did not occur. + * See {@link JobVersion} 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, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, parameters: models.JobTargetGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a target group. - * - * @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} jobAgentName The name of the job agent. + * Gets all versions of a job. * - * @param {string} targetGroupName The name of the target group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -21032,24 +23003,17 @@ export interface JobTargetGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a target group. - * - * @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} jobAgentName The name of the job agent. + * Gets all versions of a job. * - * @param {string} targetGroupName The name of the target group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -21063,7 +23027,7 @@ export interface JobTargetGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {JobVersionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21071,22 +23035,37 @@ export interface JobTargetGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {JobVersionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobVersionListResult} 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. */ - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, jobAgentName: string, targetGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobNext(nextPageLink: string, callback: ServiceCallback): void; + listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LongTermRetentionBackups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface LongTermRetentionBackups { /** - * Gets all target groups in an agent. + * Gets a long term retention backup. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -21095,17 +23074,22 @@ export interface JobTargetGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAgentNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all target groups in an agent. + * Gets a long term retention backup. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -21119,7 +23103,7 @@ export interface JobTargetGroups { * * {Promise} A promise is returned. * - * @resolve {JobTargetGroupListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21127,40 +23111,29 @@ export interface JobTargetGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobTargetGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobTargetGroupListResult} for more + * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} 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. */ - listByAgentNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByAgentNext(nextPageLink: string, callback: ServiceCallback): void; - listByAgentNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * JobVersions - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface JobVersions { + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all versions of a job. + * Deletes a long term retention backup. * - * @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} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} jobAgentName The name of the job agent. + * @param {string} longTermRetentionDatabaseName * - * @param {string} jobName The name of the job to get. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -21169,24 +23142,22 @@ export interface JobVersions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByJobWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all versions of a job. + * Deletes a long term retention backup. * - * @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} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} jobAgentName The name of the job agent. + * @param {string} longTermRetentionDatabaseName * - * @param {string} jobName The name of the job to get. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -21200,7 +23171,7 @@ export interface JobVersions { * * {Promise} A promise is returned. * - * @resolve {JobVersionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21208,62 +23179,63 @@ export interface JobVersions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobVersionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobVersionListResult} 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. */ - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, callback: ServiceCallback): void; - listByJob(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a job version. + * Lists all long term retention backups for a database. * - * @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} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} jobAgentName The name of the job agent. + * @param {string} longTermRetentionDatabaseName * - * @param {string} jobName The name of the job. + * @param {object} [options] Optional Parameters. * - * @param {number} jobVersion The version of the job to get. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @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. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a job version. + * Lists all long term retention backups for a database. * - * @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} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} jobAgentName The name of the job agent. + * @param {string} longTermRetentionDatabaseName * - * @param {string} jobName The name of the job. + * @param {object} [options] Optional Parameters. * - * @param {number} jobVersion The version of the job to get. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21275,7 +23247,7 @@ export interface JobVersions { * * {Promise} A promise is returned. * - * @resolve {JobVersion} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21283,45 +23255,58 @@ export interface JobVersions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobVersion} [result] - The deserialized result object if an error did not occur. - * See {@link JobVersion} for more information. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} 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, jobAgentName: string, jobName: string, jobVersion: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, jobAgentName: string, jobName: string, jobVersion: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, callback: ServiceCallback): void; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all versions of a job. + * Lists the long term retention backups for a given location. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} locationName The location of the database * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * * @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. */ - listByJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all versions of a job. + * Lists the long term retention backups for a given location. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} locationName The location of the database * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21332,7 +23317,7 @@ export interface JobVersions { * * {Promise} A promise is returned. * - * @resolve {JobVersionListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21340,63 +23325,61 @@ export interface JobVersions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobVersionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobVersionListResult} for more information. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} 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. */ - listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobNext(nextPageLink: string, callback: ServiceCallback): void; - listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * LongTermRetentionBackups - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface LongTermRetentionBackups { + listByLocation(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a long term retention backup. + * Lists the long term retention backups for a given server. * - * @param {string} locationName The location of the database. + * @param {string} locationName The location of the database * * @param {string} longTermRetentionServerName * - * @param {string} longTermRetentionDatabaseName + * @param {object} [options] Optional Parameters. * - * @param {string} backupName The backup name. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @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. */ - getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a long term retention backup. + * Lists the long term retention backups for a given server. * - * @param {string} locationName The location of the database. + * @param {string} locationName The location of the database * * @param {string} longTermRetentionServerName * - * @param {string} longTermRetentionDatabaseName + * @param {object} [options] Optional Parameters. * - * @param {string} backupName The backup name. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -21408,7 +23391,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackup} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21416,17 +23399,17 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackup} for more + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} 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(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; - get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(locationName: string, longTermRetentionServerName: string, callback: ServiceCallback): void; + listByServer(locationName: string, longTermRetentionServerName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -21451,7 +23434,7 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes a long term retention backup. @@ -21490,29 +23473,19 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; - deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Lists all long term retention backups for a database. * - * @param {string} locationName The location of the database - * - * @param {string} longTermRetentionServerName - * - * @param {string} longTermRetentionDatabaseName + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21522,26 +23495,16 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists all long term retention backups for a database. * - * @param {string} locationName The location of the database - * - * @param {string} longTermRetentionServerName - * - * @param {string} longTermRetentionDatabaseName + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21568,25 +23531,19 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, callback: ServiceCallback): void; - listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** * Lists the long term retention backups for a given location. * - * @param {string} locationName The location of the database + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21596,22 +23553,16 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists the long term retention backups for a given location. * - * @param {string} locationName The location of the database + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21638,27 +23589,19 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByLocation(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByLocation(locationName: string, callback: ServiceCallback): void; - listByLocation(locationName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Lists the long term retention backups for a given server. * - * @param {string} locationName The location of the database - * - * @param {string} longTermRetentionServerName + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21668,24 +23611,16 @@ export interface LongTermRetentionBackups { * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists the long term retention backups for a given server. * - * @param {string} locationName The location of the database - * - * @param {string} longTermRetentionServerName + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21712,21 +23647,30 @@ export interface LongTermRetentionBackups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(locationName: string, longTermRetentionServerName: string, callback: ServiceCallback): void; - listByServer(locationName: string, longTermRetentionServerName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, 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; +} + +/** + * @class + * BackupLongTermRetentionPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface BackupLongTermRetentionPolicies { /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Gets a database's long term retention policy. * - * @param {string} longTermRetentionServerName + * @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} longTermRetentionDatabaseName + * @param {string} serverName The name of the server. * - * @param {string} backupName The backup name. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -21735,22 +23679,22 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Gets a database's long term retention policy. * - * @param {string} longTermRetentionServerName + * @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} longTermRetentionDatabaseName + * @param {string} serverName The name of the server. * - * @param {string} backupName The backup name. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -21764,7 +23708,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21772,22 +23716,43 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} 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. */ - beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; - beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Lists all long term retention backups for a database. + * Sets a database's long term retention policy. * - * @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 {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -21796,17 +23761,36 @@ export interface LongTermRetentionBackups { * * @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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all long term retention backups for a database. + * Sets a database's long term retention policy. * - * @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 {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -21820,7 +23804,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21828,24 +23812,29 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} 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. */ - 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; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the long term retention backups for a given location. + * Gets a database's long 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} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -21854,17 +23843,22 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given location. + * Gets a database's long term retention policy. * - * @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 {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -21878,7 +23872,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21886,24 +23880,43 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} 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. */ - listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; - listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Lists the long term retention backups for a given server. + * Sets a database's long term retention policy. * - * @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 {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -21912,17 +23925,36 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given server. + * Sets a database's long term retention policy. * - * @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 {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -21936,7 +23968,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -21944,38 +23976,41 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} 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; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * BackupLongTermRetentionPolicies + * ManagedDatabases * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface BackupLongTermRetentionPolicies { +export interface ManagedDatabases { /** - * Gets a database's long term retention policy. + * Completes the restore operation on a managed database. * - * @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} locationName The name of the region where the resource is + * located. * - * @param {string} serverName The name of the server. + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} databaseName The name of the database. + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -21984,22 +24019,25 @@ export interface BackupLongTermRetentionPolicies { * * @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>; + completeRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's long term retention policy. + * Completes the restore operation on a managed database. * - * @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} locationName The name of the region where the resource is + * located. * - * @param {string} serverName The name of the server. + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} databaseName The name of the database. + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -22013,7 +24051,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22021,43 +24059,25 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} 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. */ - 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; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Sets a database's long term retention policy. + * Gets a list of managed databases. * * @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 long term retention policy info. - * - * @param {string} [parameters.weeklyRetention] The weekly retention policy for - * an LTR backup in an ISO 8601 format. - * - * @param {string} [parameters.monthlyRetention] The montly retention policy - * for an LTR backup in an ISO 8601 format. - * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. - * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -22066,36 +24086,20 @@ export interface BackupLongTermRetentionPolicies { * * @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.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByInstanceWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets a database's long term retention policy. + * Gets a list of managed databases. * * @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 long term retention policy info. - * - * @param {string} [parameters.weeklyRetention] The weekly retention policy for - * an LTR backup in an ISO 8601 format. - * - * @param {string} [parameters.monthlyRetention] The montly retention policy - * for an LTR backup in an ISO 8601 format. - * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. - * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -22109,7 +24113,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {ManagedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22117,27 +24121,27 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more + * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} 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.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByInstance(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByInstance(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + listByInstance(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database's long term retention policy. + * Gets a managed database. * * @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} managedInstanceName The name of the managed instance. * * @param {string} databaseName The name of the database. * @@ -22148,20 +24152,20 @@ export interface BackupLongTermRetentionPolicies { * * @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>; + getWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's long term retention policy. + * Gets a managed database. * * @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} managedInstanceName The name of the managed instance. * * @param {string} databaseName The name of the database. * @@ -22177,7 +24181,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22185,43 +24189,64 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more - * information. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Sets a database's long term retention policy. + * Creates a new database or updates an existing database. * * @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} managedInstanceName The name of the managed instance. * * @param {string} databaseName The name of the database. * - * @param {object} parameters The long term retention policy info. + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. * - * @param {string} [parameters.weeklyRetention] The weekly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} [parameters.monthlyRetention] The montly retention policy - * for an LTR backup in an ISO 8601 format. + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} parameters.location Resource location. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -22230,36 +24255,58 @@ export interface BackupLongTermRetentionPolicies { * * @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, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets a database's long term retention policy. + * Creates a new database or updates an existing database. * * @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} managedInstanceName The name of the managed instance. * * @param {string} databaseName The name of the database. * - * @param {object} parameters The long term retention policy info. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.weeklyRetention] The weekly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} [parameters.collation] Collation of the managed database. * - * @param {string} [parameters.monthlyRetention] The montly retention policy - * for an LTR backup in an ISO 8601 format. + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -22273,7 +24320,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22281,41 +24328,28 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more - * information. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ManagedDatabases - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ManagedDatabases { + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Completes the restore operation on a managed database. - * - * @param {string} locationName The name of the region where the resource is - * located. + * Deletes the managed database. * - * @param {uuid} operationId Management operation id that this request tries to - * complete. + * @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 {object} parameters The definition for completing the restore of this - * managed database. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} parameters.lastBackupName The last backup name to apply + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -22328,21 +24362,18 @@ export interface ManagedDatabases { * * @reject {Error|ServiceError} - The error object. */ - completeRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Completes the restore operation on a managed database. - * - * @param {string} locationName The name of the region where the resource is - * located. + * Deletes the managed database. * - * @param {uuid} operationId Management operation id that this request tries to - * complete. + * @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 {object} parameters The definition for completing the restore of this - * managed database. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} parameters.lastBackupName The last backup name to apply + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -22370,13 +24401,13 @@ export interface ManagedDatabases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; - completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of managed databases. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -22384,6 +24415,42 @@ export interface ManagedDatabases { * * @param {string} managedInstanceName The name of the managed instance. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -22391,14 +24458,14 @@ export interface ManagedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByInstanceWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of managed databases. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -22406,6 +24473,42 @@ export interface ManagedDatabases { * * @param {string} managedInstanceName The name of the managed instance. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -22418,7 +24521,7 @@ export interface ManagedDatabases { * * {Promise} A promise is returned. * - * @resolve {ManagedDatabaseListResult} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22426,29 +24529,31 @@ export interface ManagedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedDatabaseListResult} for more - * information. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} 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. */ - listByInstance(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByInstance(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; - listByInstance(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a managed database. + * Completes the restore operation on a managed database. * - * @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} locationName The name of the region where the resource is + * located. * - * @param {string} managedInstanceName The name of the managed instance. + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} databaseName The name of the database. + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -22457,22 +24562,25 @@ export interface ManagedDatabases { * * @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, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCompleteRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a managed database. + * Completes the restore operation on a managed database. * - * @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} locationName The name of the region where the resource is + * located. * - * @param {string} managedInstanceName The name of the managed instance. + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} databaseName The name of the database. + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -22486,7 +24594,7 @@ export interface ManagedDatabases { * * {Promise} A promise is returned. * - * @resolve {ManagedDatabase} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22494,16 +24602,15 @@ export interface ManagedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedDatabase} 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. */ - get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -22564,7 +24671,7 @@ export interface ManagedDatabases { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates a new database or updates an existing database. @@ -22640,9 +24747,9 @@ export interface ManagedDatabases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -22667,7 +24774,7 @@ export interface ManagedDatabases { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes the managed database. @@ -22706,9 +24813,9 @@ export interface ManagedDatabases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -22767,7 +24874,7 @@ export interface ManagedDatabases { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates an existing database. @@ -22841,24 +24948,16 @@ export interface ManagedDatabases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Completes the restore operation on a managed database. - * - * @param {string} locationName The name of the region where the resource is - * located. - * - * @param {uuid} operationId Management operation id that this request tries to - * complete. - * - * @param {object} parameters The definition for completing the restore of this - * managed database. + * Gets a list of managed databases. * - * @param {string} parameters.lastBackupName The last backup name to apply + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -22867,25 +24966,17 @@ export interface ManagedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCompleteRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByInstanceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Completes the restore operation on a managed database. - * - * @param {string} locationName The name of the region where the resource is - * located. - * - * @param {uuid} operationId Management operation id that this request tries to - * complete. - * - * @param {object} parameters The definition for completing the restore of this - * managed database. + * Gets a list of managed databases. * - * @param {string} parameters.lastBackupName The last backup name to apply + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -22899,7 +24990,7 @@ export interface ManagedDatabases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ManagedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22907,123 +24998,154 @@ export interface ManagedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} 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. */ - beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; - beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByInstanceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByInstanceNext(nextPageLink: string, callback: ServiceCallback): void; + listByInstanceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SensitivityLabels + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SensitivityLabels { /** - * Creates a new database or updates an existing database. + * Gets the sensitivity labels of a given database * * @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 {string} serverName The name of the server. * * @param {string} databaseName The name of the database. * - * @param {object} parameters The requested database resource state. - * - * @param {string} [parameters.collation] Collation of the managed database. + * @param {object} [options] Optional Parameters. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. Specifies the point in time - * (ISO8601 format) of the source database that will be restored to create the - * new database. + * @param {string} [options.filter] An OData filter expression that filters + * elements in the collection. * - * @param {string} [parameters.catalogCollation] Collation of the metadata - * catalog. Possible values include: 'DATABASE_DEFAULT', - * 'SQL_Latin1_General_CP1_CI_AS' + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.createMode] Managed database create mode. - * PointInTimeRestore: Create a database by restoring a point in time backup of - * an existing database. SourceDatabaseName, SourceManagedInstanceName and - * PointInTime must be specified. RestoreExternalBackup: Create a database by - * restoring from external backup files. Collation, StorageContainerUri and - * StorageContainerSasToken must be specified. Possible values include: - * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.storageContainerUri] Conditional. If createMode - * is RestoreExternalBackup, this value is required. Specifies the uri of the - * storage container where backups for this restore are stored. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.sourceDatabaseId] The resource identifier of the - * source database associated with create operation of this database. + * @reject {Error|ServiceError} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the sensitivity labels of a given database * - * @param {string} [parameters.storageContainerSasToken] Conditional. If - * createMode is RestoreExternalBackup, this value is required. Specifies the - * storage container sas token. + * @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} parameters.location Resource location. + * @param {string} serverName The name of the server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] An OData filter expression that filters + * elements in the collection. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {Promise} A promise is returned. + * + * @resolve {SensitivityLabelListResult} - 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. + * + * {SensitivityLabelListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SensitivityLabelListResult} 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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Creates a new database or updates an existing database. + * Gets the sensitivity label of a given column * * @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 {string} serverName The name of the server. * * @param {string} databaseName The name of the database. * - * @param {object} parameters The requested database resource state. + * @param {string} schemaName The name of the schema. * - * @param {string} [parameters.collation] Collation of the managed database. + * @param {string} tableName The name of the table. * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. Specifies the point in time - * (ISO8601 format) of the source database that will be restored to create the - * new database. + * @param {string} columnName The name of the column. * - * @param {string} [parameters.catalogCollation] Collation of the metadata - * catalog. Possible values include: 'DATABASE_DEFAULT', - * 'SQL_Latin1_General_CP1_CI_AS' + * @param {string} sensitivityLabelSource The source of the sensitivity label. + * Possible values include: 'current', 'recommended' * - * @param {string} [parameters.createMode] Managed database create mode. - * PointInTimeRestore: Create a database by restoring a point in time backup of - * an existing database. SourceDatabaseName, SourceManagedInstanceName and - * PointInTime must be specified. RestoreExternalBackup: Create a database by - * restoring from external backup files. Collation, StorageContainerUri and - * StorageContainerSasToken must be specified. Possible values include: - * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.storageContainerUri] Conditional. If createMode - * is RestoreExternalBackup, this value is required. Specifies the uri of the - * storage container where backups for this restore are stored. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.sourceDatabaseId] The resource identifier of the - * source database associated with create operation of this database. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.storageContainerSasToken] Conditional. If - * createMode is RestoreExternalBackup, this value is required. Specifies the - * storage container sas token. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} parameters.location Resource location. + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, sensitivityLabelSource: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the sensitivity label of a given column * - * @param {object} [parameters.tags] Resource tags. + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {string} sensitivityLabelSource The source of the sensitivity label. + * Possible values include: 'current', 'recommended' * * @param {object} [options] Optional Parameters. * @@ -23037,7 +25159,7 @@ export interface ManagedDatabases { * * {Promise} A promise is returned. * - * @resolve {ManagedDatabase} - The deserialized result object. + * @resolve {SensitivityLabel} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23045,29 +25167,41 @@ export interface ManagedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedDatabase} for more information. + * {SensitivityLabel} [result] - The deserialized result object if an error did not occur. + * See {@link SensitivityLabel} 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, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, sensitivityLabelSource: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, sensitivityLabelSource: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, sensitivityLabelSource: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the managed database. + * Creates or updates the sensitivity label of a given column * * @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 {string} serverName The name of the server. * * @param {string} databaseName The name of the database. * + * @param {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {object} parameters The column sensitivity label resource. + * + * @param {string} [parameters.labelName] The label name. + * + * @param {string} [parameters.informationType] The information type. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23075,23 +25209,35 @@ export interface ManagedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, parameters: models.SensitivityLabel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the managed database. + * Creates or updates the sensitivity label of a given column * * @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 {string} serverName The name of the server. * * @param {string} databaseName The name of the database. * + * @param {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {object} parameters The column sensitivity label resource. + * + * @param {string} [parameters.labelName] The label name. + * + * @param {string} [parameters.informationType] The information type. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -23104,7 +25250,7 @@ export interface ManagedDatabases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SensitivityLabel} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23112,61 +25258,34 @@ export interface ManagedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SensitivityLabel} [result] - The deserialized result object if an error did not occur. + * See {@link SensitivityLabel} 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. */ - beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, parameters: models.SensitivityLabel, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, parameters: models.SensitivityLabel, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, parameters: models.SensitivityLabel, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing database. + * Deletes the sensitivity label of a given column * * @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 {string} serverName The name of the server. * * @param {string} databaseName The name of the database. * - * @param {object} parameters The requested database resource state. - * - * @param {string} [parameters.collation] Collation of the managed database. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. Specifies the point in time - * (ISO8601 format) of the source database that will be restored to create the - * new database. - * - * @param {string} [parameters.catalogCollation] Collation of the metadata - * catalog. Possible values include: 'DATABASE_DEFAULT', - * 'SQL_Latin1_General_CP1_CI_AS' - * - * @param {string} [parameters.createMode] Managed database create mode. - * PointInTimeRestore: Create a database by restoring a point in time backup of - * an existing database. SourceDatabaseName, SourceManagedInstanceName and - * PointInTime must be specified. RestoreExternalBackup: Create a database by - * restoring from external backup files. Collation, StorageContainerUri and - * StorageContainerSasToken must be specified. Possible values include: - * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' - * - * @param {string} [parameters.storageContainerUri] Conditional. If createMode - * is RestoreExternalBackup, this value is required. Specifies the uri of the - * storage container where backups for this restore are stored. - * - * @param {string} [parameters.sourceDatabaseId] The resource identifier of the - * source database associated with create operation of this database. + * @param {string} schemaName The name of the schema. * - * @param {string} [parameters.storageContainerSasToken] Conditional. If - * createMode is RestoreExternalBackup, this value is required. Specifies the - * storage container sas token. + * @param {string} tableName The name of the table. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} columnName The name of the column. * * @param {object} [options] Optional Parameters. * @@ -23175,56 +25294,28 @@ export interface ManagedDatabases { * * @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, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing database. + * Deletes the sensitivity label of a given column * * @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 {string} serverName The name of the server. * * @param {string} databaseName The name of the database. * - * @param {object} parameters The requested database resource state. - * - * @param {string} [parameters.collation] Collation of the managed database. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. Specifies the point in time - * (ISO8601 format) of the source database that will be restored to create the - * new database. - * - * @param {string} [parameters.catalogCollation] Collation of the metadata - * catalog. Possible values include: 'DATABASE_DEFAULT', - * 'SQL_Latin1_General_CP1_CI_AS' - * - * @param {string} [parameters.createMode] Managed database create mode. - * PointInTimeRestore: Create a database by restoring a point in time backup of - * an existing database. SourceDatabaseName, SourceManagedInstanceName and - * PointInTime must be specified. RestoreExternalBackup: Create a database by - * restoring from external backup files. Collation, StorageContainerUri and - * StorageContainerSasToken must be specified. Possible values include: - * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' - * - * @param {string} [parameters.storageContainerUri] Conditional. If createMode - * is RestoreExternalBackup, this value is required. Specifies the uri of the - * storage container where backups for this restore are stored. - * - * @param {string} [parameters.sourceDatabaseId] The resource identifier of the - * source database associated with create operation of this database. + * @param {string} schemaName The name of the schema. * - * @param {string} [parameters.storageContainerSasToken] Conditional. If - * createMode is RestoreExternalBackup, this value is required. Specifies the - * storage container sas token. + * @param {string} tableName The name of the table. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} columnName The name of the column. * * @param {object} [options] Optional Parameters. * @@ -23238,7 +25329,7 @@ export interface ManagedDatabases { * * {Promise} A promise is returned. * - * @resolve {ManagedDatabase} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23246,20 +25337,19 @@ export interface ManagedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedDatabase} 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, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, schemaName: string, tableName: string, columnName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of managed databases. + * Gets the sensitivity labels of a given database * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -23271,14 +25361,14 @@ export interface ManagedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByInstanceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of managed databases. + * Gets the sensitivity labels of a given database * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -23295,7 +25385,7 @@ export interface ManagedDatabases { * * {Promise} A promise is returned. * - * @resolve {ManagedDatabaseListResult} - The deserialized result object. + * @resolve {SensitivityLabelListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23303,17 +25393,17 @@ export interface ManagedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedDatabaseListResult} for more + * {SensitivityLabelListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SensitivityLabelListResult} 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. */ - listByInstanceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByInstanceNext(nextPageLink: string, callback: ServiceCallback): void; - listByInstanceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; } /** @@ -23859,7 +25949,210 @@ export interface ServerDnsAliases { * @param {string} serverName The name of the server that the alias is pointing * to. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @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 {ServerDnsAlias} - 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. + * + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} 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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the server DNS alias with the given name. + * + * @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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the server DNS alias with the given name. + * + * @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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @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. + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Acquires server DNS alias from another 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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @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. + */ + beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Acquires server DNS alias from another 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 that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @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. + */ + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, callback: ServiceCallback): void; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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 + * + * @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. * @@ -23873,7 +26166,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23881,29 +26174,36 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} for more information. + * {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, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, 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; +} + +/** + * @class + * ServerSecurityAlertPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerSecurityAlertPolicies { /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. - * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -23912,23 +26212,20 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. - * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -23942,7 +26239,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerSecurityAlertPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23950,33 +26247,53 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Acquires server DNS alias from another server. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server dns alias. + * @param {object} parameters The server security alert policy. * - * @param {object} parameters + * @param {string} parameters.state Specifies the state of the policy, whether + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @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. * @@ -23985,28 +26302,46 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Acquires server DNS alias from another server. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server dns alias. + * @param {object} parameters The server security alert policy. * - * @param {object} parameters + * @param {string} parameters.state Specifies the state of the policy, whether + * it is enabled or disabled. Possible values include: 'New', 'Enabled', + * 'Disabled' * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @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. * @@ -24020,7 +26355,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerSecurityAlertPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24028,22 +26363,53 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, callback: ServiceCallback): void; - beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Gets a list of server DNS aliases for a server. + * Creates or updates a threat detection policy. * - * @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 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. * @@ -24052,17 +26418,46 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server DNS aliases for a server. + * Creates or updates a threat detection policy. * - * @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 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. * @@ -24076,7 +26471,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * @resolve {ServerSecurityAlertPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -24084,17 +26479,17 @@ export interface ServerDnsAliases { * * {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 + * {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. */ - 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; + 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; } /** @@ -26495,6 +28890,74 @@ export interface BackupShortTermRetentionPolicies { update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupShortTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * 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|ServiceError} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {BackupShortTermRetentionPolicyListResult} - 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. + * + * {BackupShortTermRetentionPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupShortTermRetentionPolicyListResult} + * 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; + + /** * Updates a database's short term retention policy. * @@ -26649,6 +29112,64 @@ export interface BackupShortTermRetentionPolicies { 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; + + + /** + * 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|ServiceError} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {BackupShortTermRetentionPolicyListResult} - 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. + * + * {BackupShortTermRetentionPolicyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link BackupShortTermRetentionPolicyListResult} + * 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. + */ + 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; } /** diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 592af86dc9..843f7da4ff 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -37,7 +37,6 @@ 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'); @@ -49,6 +48,10 @@ 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'); @@ -63,8 +66,10 @@ exports.JobVersions = require('./jobVersions'); exports.LongTermRetentionBackups = require('./longTermRetentionBackups'); exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPolicies'); exports.ManagedDatabases = require('./managedDatabases'); +exports.SensitivityLabels = require('./sensitivityLabels'); exports.ServerAutomaticTuningOperations = require('./serverAutomaticTuningOperations'); exports.ServerDnsAliases = require('./serverDnsAliases'); +exports.ServerSecurityAlertPolicies = require('./serverSecurityAlertPolicies'); exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); diff --git a/lib/services/sqlManagement2/lib/operations/sensitivityLabels.js b/lib/services/sqlManagement2/lib/operations/sensitivityLabels.js new file mode 100644 index 0000000000..0d14175b2e --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/sensitivityLabels.js @@ -0,0 +1,1390 @@ +/* + * 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; + +/** + * Gets the sensitivity labels of a given database + * + * @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 {string} [options.filter] An OData filter expression that filters + * elements in the collection. + * + * @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 SensitivityLabelListResult} 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2017-03-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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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}/sensitivityLabels'; + 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 = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + 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['SensitivityLabelListResult']().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); + }); +} + +/** + * Gets the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {string} sensitivityLabelSource The source of the sensitivity label. + * Possible values include: 'current', 'recommended' + * + * @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 SensitivityLabel} 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 _get(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, 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-03-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 (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') { + throw new Error('schemaName cannot be null or undefined and it must be of type string.'); + } + if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') { + throw new Error('tableName cannot be null or undefined and it must be of type string.'); + } + if (columnName === null || columnName === undefined || typeof columnName.valueOf() !== 'string') { + throw new Error('columnName cannot be null or undefined and it must be of type string.'); + } + if (sensitivityLabelSource) { + let allowedValues = [ 'current', 'recommended' ]; + if (!allowedValues.some( function(item) { return item === sensitivityLabelSource; })) { + throw new Error(sensitivityLabelSource + ' is not a valid value. The valid values are: ' + allowedValues); + } + } else { + throw new Error('sensitivityLabelSource 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}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName)); + requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName)); + requestUrl = requestUrl.replace('{columnName}', encodeURIComponent(columnName)); + requestUrl = requestUrl.replace('{sensitivityLabelSource}', encodeURIComponent(sensitivityLabelSource)); + 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['SensitivityLabel']().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); + }); +} + +/** + * Creates or updates the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {object} parameters The column sensitivity label resource. + * + * @param {string} [parameters.labelName] The label name. + * + * @param {string} [parameters.informationType] The information type. + * + * @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 SensitivityLabel} 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 _createOrUpdate(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, 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 sensitivityLabelSource = 'current'; + let apiVersion = '2017-03-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 (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') { + throw new Error('schemaName cannot be null or undefined and it must be of type string.'); + } + if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') { + throw new Error('tableName cannot be null or undefined and it must be of type string.'); + } + if (columnName === null || columnName === undefined || typeof columnName.valueOf() !== 'string') { + throw new Error('columnName 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}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName)); + requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName)); + requestUrl = requestUrl.replace('{columnName}', encodeURIComponent(columnName)); + requestUrl = requestUrl.replace('{sensitivityLabelSource}', encodeURIComponent(sensitivityLabelSource)); + 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 = 'PUT'; + 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['SensitivityLabel']().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 !== 201) { + 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['SensitivityLabel']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SensitivityLabel']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @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 _deleteMethod(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, 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 sensitivityLabelSource = 'current'; + let apiVersion = '2017-03-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 (schemaName === null || schemaName === undefined || typeof schemaName.valueOf() !== 'string') { + throw new Error('schemaName cannot be null or undefined and it must be of type string.'); + } + if (tableName === null || tableName === undefined || typeof tableName.valueOf() !== 'string') { + throw new Error('tableName cannot be null or undefined and it must be of type string.'); + } + if (columnName === null || columnName === undefined || typeof columnName.valueOf() !== 'string') { + throw new Error('columnName 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{schemaName}', encodeURIComponent(schemaName)); + requestUrl = requestUrl.replace('{tableName}', encodeURIComponent(tableName)); + requestUrl = requestUrl.replace('{columnName}', encodeURIComponent(columnName)); + requestUrl = requestUrl.replace('{sensitivityLabelSource}', encodeURIComponent(sensitivityLabelSource)); + 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 = 'DELETE'; + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the sensitivity labels of a given database + * + * @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 SensitivityLabelListResult} 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['SensitivityLabelListResult']().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 SensitivityLabels. */ +class SensitivityLabels { + /** + * Create a SensitivityLabels. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByDatabase = _listByDatabase; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._listByDatabaseNext = _listByDatabaseNext; + } + + /** + * Gets the sensitivity labels of a given database + * + * @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 {string} [options.filter] An OData filter expression that filters + * elements in the collection. + * + * @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 the sensitivity labels of a given database + * + * @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 {string} [options.filter] An OData filter expression that filters + * elements in the collection. + * + * @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 {SensitivityLabelListResult} - 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 SensitivityLabelListResult} 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); + } + } + + /** + * Gets the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {string} sensitivityLabelSource The source of the sensitivity label. + * Possible values include: 'current', 'recommended' + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {string} sensitivityLabelSource The source of the sensitivity label. + * Possible values include: 'current', 'recommended' + * + * @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 {SensitivityLabel} - 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 SensitivityLabel} 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. + */ + get(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, 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._get(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options, optionalCallback); + } + } + + /** + * Creates or updates the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {object} parameters The column sensitivity label resource. + * + * @param {string} [parameters.labelName] The label name. + * + * @param {string} [parameters.informationType] The information type. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, 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 or updates the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @param {object} parameters The column sensitivity label resource. + * + * @param {string} [parameters.labelName] The label name. + * + * @param {string} [parameters.informationType] The information type. + * + * @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 {SensitivityLabel} - 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 SensitivityLabel} 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. + */ + createOrUpdate(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, 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._createOrUpdate(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the sensitivity label of a given column + * + * @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 {string} schemaName The name of the schema. + * + * @param {string} tableName The name of the table. + * + * @param {string} columnName The name of the column. + * + * @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. + */ + deleteMethod(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, 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._deleteMethod(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options, optionalCallback); + } + } + + /** + * Gets the sensitivity labels of a given database + * + * @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 the sensitivity labels of a given database + * + * @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 {SensitivityLabelListResult} - 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 SensitivityLabelListResult} 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 = SensitivityLabels; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 8fa0288e8b..63530295d1 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -77,7 +77,6 @@ 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; @@ -89,6 +88,10 @@ 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; @@ -103,8 +106,10 @@ export default class SqlManagementClient extends AzureServiceClient { longTermRetentionBackups: operations.LongTermRetentionBackups; backupLongTermRetentionPolicies: operations.BackupLongTermRetentionPolicies; managedDatabases: operations.ManagedDatabases; + sensitivityLabels: operations.SensitivityLabels; serverAutomaticTuningOperations: operations.ServerAutomaticTuningOperations; serverDnsAliases: operations.ServerDnsAliases; + serverSecurityAlertPolicies: operations.ServerSecurityAlertPolicies; restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index d2c64dd612..afcfd5b382 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -94,7 +94,6 @@ 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); @@ -106,6 +105,10 @@ 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); @@ -120,8 +123,10 @@ class SqlManagementClient extends ServiceClient { this.longTermRetentionBackups = new operations.LongTermRetentionBackups(this); this.backupLongTermRetentionPolicies = new operations.BackupLongTermRetentionPolicies(this); this.managedDatabases = new operations.ManagedDatabases(this); + this.sensitivityLabels = new operations.SensitivityLabels(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); diff --git a/lib/services/sqlManagement2/package.json b/lib/services/sqlManagement2/package.json index a13187766e..f9a62805fe 100644 --- a/lib/services/sqlManagement2/package.json +++ b/lib/services/sqlManagement2/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-sql", "author": "Microsoft Corporation", "description": "SqlManagementClient Library with typescript type definitions for node", - "version": "3.0.0", + "version": "4.1.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5"