Skip to content

Commit 0c50434

Browse files
authored
[AutoPR sql/resource-manager] Add BackupShortTermRetentionListResult and update exceptions (#2711)
* Generated from f2bb07205397d5771778173d8fc08e1660441fc7 Add BackupShortTermRetentionListResult and update exceptions * Generated from ca8661c9673dc5775e0bc7ce94fb773805235953 Use comnmon definition for ProxyResource * Generated from 65482c1a0eb55bd7b3dbf9be9f7018a0df05d229 Add ListShortTermRetentionPoliciesByDatabase example
1 parent bff5610 commit 0c50434

18 files changed

+1754
-28
lines changed

azure-mgmt-sql/azure/mgmt/sql/models/__init__.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
from .transparent_data_encryption_activity_py3 import TransparentDataEncryptionActivity
4949
from .server_usage_py3 import ServerUsage
5050
from .database_usage_py3 import DatabaseUsage
51-
from .database_blob_auditing_policy_py3 import DatabaseBlobAuditingPolicy
5251
from .automatic_tuning_options_py3 import AutomaticTuningOptions
5352
from .database_automatic_tuning_py3 import DatabaseAutomaticTuning
5453
from .encryption_protector_py3 import EncryptionProtector
@@ -81,6 +80,10 @@
8180
from .sync_member_py3 import SyncMember
8281
from .subscription_usage_py3 import SubscriptionUsage
8382
from .virtual_network_rule_py3 import VirtualNetworkRule
83+
from .extended_database_blob_auditing_policy_py3 import ExtendedDatabaseBlobAuditingPolicy
84+
from .extended_server_blob_auditing_policy_py3 import ExtendedServerBlobAuditingPolicy
85+
from .server_blob_auditing_policy_py3 import ServerBlobAuditingPolicy
86+
from .database_blob_auditing_policy_py3 import DatabaseBlobAuditingPolicy
8487
from .database_vulnerability_assessment_rule_baseline_item_py3 import DatabaseVulnerabilityAssessmentRuleBaselineItem
8588
from .database_vulnerability_assessment_rule_baseline_py3 import DatabaseVulnerabilityAssessmentRuleBaseline
8689
from .vulnerability_assessment_recurring_scans_properties_py3 import VulnerabilityAssessmentRecurringScansProperties
@@ -184,7 +187,6 @@
184187
from .transparent_data_encryption_activity import TransparentDataEncryptionActivity
185188
from .server_usage import ServerUsage
186189
from .database_usage import DatabaseUsage
187-
from .database_blob_auditing_policy import DatabaseBlobAuditingPolicy
188190
from .automatic_tuning_options import AutomaticTuningOptions
189191
from .database_automatic_tuning import DatabaseAutomaticTuning
190192
from .encryption_protector import EncryptionProtector
@@ -217,6 +219,10 @@
217219
from .sync_member import SyncMember
218220
from .subscription_usage import SubscriptionUsage
219221
from .virtual_network_rule import VirtualNetworkRule
222+
from .extended_database_blob_auditing_policy import ExtendedDatabaseBlobAuditingPolicy
223+
from .extended_server_blob_auditing_policy import ExtendedServerBlobAuditingPolicy
224+
from .server_blob_auditing_policy import ServerBlobAuditingPolicy
225+
from .database_blob_auditing_policy import DatabaseBlobAuditingPolicy
220226
from .database_vulnerability_assessment_rule_baseline_item import DatabaseVulnerabilityAssessmentRuleBaselineItem
221227
from .database_vulnerability_assessment_rule_baseline import DatabaseVulnerabilityAssessmentRuleBaseline
222228
from .vulnerability_assessment_recurring_scans_properties import VulnerabilityAssessmentRecurringScansProperties
@@ -332,6 +338,7 @@
332338
from .elastic_pool_operation_paged import ElasticPoolOperationPaged
333339
from .vulnerability_assessment_scan_record_paged import VulnerabilityAssessmentScanRecordPaged
334340
from .instance_failover_group_paged import InstanceFailoverGroupPaged
341+
from .backup_short_term_retention_policy_paged import BackupShortTermRetentionPolicyPaged
335342
from .sql_management_client_enums import (
336343
CheckNameAvailabilityReason,
337344
ServerConnectionType,
@@ -357,7 +364,6 @@
357364
RecommendedIndexType,
358365
TransparentDataEncryptionStatus,
359366
TransparentDataEncryptionActivityStatus,
360-
BlobAuditingPolicyState,
361367
AutomaticTuningMode,
362368
AutomaticTuningOptionModeDesired,
363369
AutomaticTuningOptionModeActual,
@@ -376,6 +382,7 @@
376382
SyncDirection,
377383
SyncMemberState,
378384
VirtualNetworkRuleState,
385+
BlobAuditingPolicyState,
379386
JobAgentState,
380387
JobExecutionLifecycle,
381388
ProvisioningState,
@@ -451,7 +458,6 @@
451458
'TransparentDataEncryptionActivity',
452459
'ServerUsage',
453460
'DatabaseUsage',
454-
'DatabaseBlobAuditingPolicy',
455461
'AutomaticTuningOptions',
456462
'DatabaseAutomaticTuning',
457463
'EncryptionProtector',
@@ -484,6 +490,10 @@
484490
'SyncMember',
485491
'SubscriptionUsage',
486492
'VirtualNetworkRule',
493+
'ExtendedDatabaseBlobAuditingPolicy',
494+
'ExtendedServerBlobAuditingPolicy',
495+
'ServerBlobAuditingPolicy',
496+
'DatabaseBlobAuditingPolicy',
487497
'DatabaseVulnerabilityAssessmentRuleBaselineItem',
488498
'DatabaseVulnerabilityAssessmentRuleBaseline',
489499
'VulnerabilityAssessmentRecurringScansProperties',
@@ -599,6 +609,7 @@
599609
'ElasticPoolOperationPaged',
600610
'VulnerabilityAssessmentScanRecordPaged',
601611
'InstanceFailoverGroupPaged',
612+
'BackupShortTermRetentionPolicyPaged',
602613
'CheckNameAvailabilityReason',
603614
'ServerConnectionType',
604615
'SecurityAlertPolicyState',
@@ -623,7 +634,6 @@
623634
'RecommendedIndexType',
624635
'TransparentDataEncryptionStatus',
625636
'TransparentDataEncryptionActivityStatus',
626-
'BlobAuditingPolicyState',
627637
'AutomaticTuningMode',
628638
'AutomaticTuningOptionModeDesired',
629639
'AutomaticTuningOptionModeActual',
@@ -642,6 +652,7 @@
642652
'SyncDirection',
643653
'SyncMemberState',
644654
'VirtualNetworkRuleState',
655+
'BlobAuditingPolicyState',
645656
'JobAgentState',
646657
'JobExecutionLifecycle',
647658
'ProvisioningState',
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.paging import Paged
13+
14+
15+
class BackupShortTermRetentionPolicyPaged(Paged):
16+
"""
17+
A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy <azure.mgmt.sql.models.BackupShortTermRetentionPolicy>` object
18+
"""
19+
20+
_attribute_map = {
21+
'next_link': {'key': 'nextLink', 'type': 'str'},
22+
'current_page': {'key': 'value', 'type': '[BackupShortTermRetentionPolicy]'}
23+
}
24+
25+
def __init__(self, *args, **kwargs):
26+
27+
super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs)

azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,72 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
4343
:param retention_days: Specifies the number of days to keep in the audit
4444
logs.
4545
:type retention_days: int
46-
:param audit_actions_and_groups: Specifies the Actions and Actions-Groups
46+
:param audit_actions_and_groups: Specifies the Actions-Groups and Actions
4747
to audit.
48+
The recommended set of action groups to use is the following combination -
49+
this will audit all the queries and stored procedures executed against the
50+
database, as well as successful and failed logins:
51+
BATCH_COMPLETED_GROUP,
52+
SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
53+
FAILED_DATABASE_AUTHENTICATION_GROUP.
54+
This above combination is also the set that is configured by default when
55+
enabling auditing from the Azure portal.
56+
The supported action groups to audit are (note: choose only specific
57+
groups that cover your auditing needs. Using unnecessary groups could lead
58+
to very large quantities of audit records):
59+
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
60+
BACKUP_RESTORE_GROUP
61+
DATABASE_LOGOUT_GROUP
62+
DATABASE_OBJECT_CHANGE_GROUP
63+
DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
64+
DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
65+
DATABASE_OPERATION_GROUP
66+
DATABASE_PERMISSION_CHANGE_GROUP
67+
DATABASE_PRINCIPAL_CHANGE_GROUP
68+
DATABASE_PRINCIPAL_IMPERSONATION_GROUP
69+
DATABASE_ROLE_MEMBER_CHANGE_GROUP
70+
FAILED_DATABASE_AUTHENTICATION_GROUP
71+
SCHEMA_OBJECT_ACCESS_GROUP
72+
SCHEMA_OBJECT_CHANGE_GROUP
73+
SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
74+
SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
75+
SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
76+
USER_CHANGE_PASSWORD_GROUP
77+
BATCH_STARTED_GROUP
78+
BATCH_COMPLETED_GROUP
79+
These are groups that cover all sql statements and stored procedures
80+
executed against the database, and should not be used in combination with
81+
other groups as this will result in duplicate audit logs.
82+
For more information, see [Database-Level Audit Action
83+
Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
84+
For Database auditing policy, specific Actions can also be specified (note
85+
that Actions cannot be specified for Server auditing policy). The
86+
supported actions to audit are:
87+
SELECT
88+
UPDATE
89+
INSERT
90+
DELETE
91+
EXECUTE
92+
RECEIVE
93+
REFERENCES
94+
The general form for defining an action to be audited is:
95+
<action> ON <object> BY <principal>
96+
Note that <object> in the above format can refer to an object like a
97+
table, view, or stored procedure, or an entire database or schema. For the
98+
latter cases, the forms DATABASE::<db_name> and SCHEMA::<schema_name> are
99+
used, respectively.
100+
For example:
101+
SELECT on dbo.myTable by public
102+
SELECT on DATABASE::myDatabase by public
103+
SELECT on SCHEMA::mySchema by public
104+
For more information, see [Database-Level Audit
105+
Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
48106
:type audit_actions_and_groups: list[str]
49107
:param storage_account_subscription_id: Specifies the blob storage
50108
subscription Id.
51109
:type storage_account_subscription_id: str
52110
:param is_storage_secondary_key_in_use: Specifies whether
53-
storageAccountAccessKey value is the storages secondary key.
111+
storageAccountAccessKey value is the storage's secondary key.
54112
:type is_storage_secondary_key_in_use: bool
55113
"""
56114

azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,72 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
4343
:param retention_days: Specifies the number of days to keep in the audit
4444
logs.
4545
:type retention_days: int
46-
:param audit_actions_and_groups: Specifies the Actions and Actions-Groups
46+
:param audit_actions_and_groups: Specifies the Actions-Groups and Actions
4747
to audit.
48+
The recommended set of action groups to use is the following combination -
49+
this will audit all the queries and stored procedures executed against the
50+
database, as well as successful and failed logins:
51+
BATCH_COMPLETED_GROUP,
52+
SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
53+
FAILED_DATABASE_AUTHENTICATION_GROUP.
54+
This above combination is also the set that is configured by default when
55+
enabling auditing from the Azure portal.
56+
The supported action groups to audit are (note: choose only specific
57+
groups that cover your auditing needs. Using unnecessary groups could lead
58+
to very large quantities of audit records):
59+
APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
60+
BACKUP_RESTORE_GROUP
61+
DATABASE_LOGOUT_GROUP
62+
DATABASE_OBJECT_CHANGE_GROUP
63+
DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
64+
DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
65+
DATABASE_OPERATION_GROUP
66+
DATABASE_PERMISSION_CHANGE_GROUP
67+
DATABASE_PRINCIPAL_CHANGE_GROUP
68+
DATABASE_PRINCIPAL_IMPERSONATION_GROUP
69+
DATABASE_ROLE_MEMBER_CHANGE_GROUP
70+
FAILED_DATABASE_AUTHENTICATION_GROUP
71+
SCHEMA_OBJECT_ACCESS_GROUP
72+
SCHEMA_OBJECT_CHANGE_GROUP
73+
SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
74+
SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
75+
SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
76+
USER_CHANGE_PASSWORD_GROUP
77+
BATCH_STARTED_GROUP
78+
BATCH_COMPLETED_GROUP
79+
These are groups that cover all sql statements and stored procedures
80+
executed against the database, and should not be used in combination with
81+
other groups as this will result in duplicate audit logs.
82+
For more information, see [Database-Level Audit Action
83+
Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
84+
For Database auditing policy, specific Actions can also be specified (note
85+
that Actions cannot be specified for Server auditing policy). The
86+
supported actions to audit are:
87+
SELECT
88+
UPDATE
89+
INSERT
90+
DELETE
91+
EXECUTE
92+
RECEIVE
93+
REFERENCES
94+
The general form for defining an action to be audited is:
95+
<action> ON <object> BY <principal>
96+
Note that <object> in the above format can refer to an object like a
97+
table, view, or stored procedure, or an entire database or schema. For the
98+
latter cases, the forms DATABASE::<db_name> and SCHEMA::<schema_name> are
99+
used, respectively.
100+
For example:
101+
SELECT on dbo.myTable by public
102+
SELECT on DATABASE::myDatabase by public
103+
SELECT on SCHEMA::mySchema by public
104+
For more information, see [Database-Level Audit
105+
Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
48106
:type audit_actions_and_groups: list[str]
49107
:param storage_account_subscription_id: Specifies the blob storage
50108
subscription Id.
51109
:type storage_account_subscription_id: str
52110
:param is_storage_secondary_key_in_use: Specifies whether
53-
storageAccountAccessKey value is the storages secondary key.
111+
storageAccountAccessKey value is the storage's secondary key.
54112
:type is_storage_secondary_key_in_use: bool
55113
"""
56114

0 commit comments

Comments
 (0)