Skip to content

Commit

Permalink
[AutoPR sql/resource-manager] Add BackupShortTermRetentionListResult …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
AutorestCI authored Jun 12, 2018
1 parent bff5610 commit 0c50434
Show file tree
Hide file tree
Showing 18 changed files with 1,754 additions and 28 deletions.
21 changes: 16 additions & 5 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
from .transparent_data_encryption_activity_py3 import TransparentDataEncryptionActivity
from .server_usage_py3 import ServerUsage
from .database_usage_py3 import DatabaseUsage
from .database_blob_auditing_policy_py3 import DatabaseBlobAuditingPolicy
from .automatic_tuning_options_py3 import AutomaticTuningOptions
from .database_automatic_tuning_py3 import DatabaseAutomaticTuning
from .encryption_protector_py3 import EncryptionProtector
Expand Down Expand Up @@ -81,6 +80,10 @@
from .sync_member_py3 import SyncMember
from .subscription_usage_py3 import SubscriptionUsage
from .virtual_network_rule_py3 import VirtualNetworkRule
from .extended_database_blob_auditing_policy_py3 import ExtendedDatabaseBlobAuditingPolicy
from .extended_server_blob_auditing_policy_py3 import ExtendedServerBlobAuditingPolicy
from .server_blob_auditing_policy_py3 import ServerBlobAuditingPolicy
from .database_blob_auditing_policy_py3 import DatabaseBlobAuditingPolicy
from .database_vulnerability_assessment_rule_baseline_item_py3 import DatabaseVulnerabilityAssessmentRuleBaselineItem
from .database_vulnerability_assessment_rule_baseline_py3 import DatabaseVulnerabilityAssessmentRuleBaseline
from .vulnerability_assessment_recurring_scans_properties_py3 import VulnerabilityAssessmentRecurringScansProperties
Expand Down Expand Up @@ -184,7 +187,6 @@
from .transparent_data_encryption_activity import TransparentDataEncryptionActivity
from .server_usage import ServerUsage
from .database_usage import DatabaseUsage
from .database_blob_auditing_policy import DatabaseBlobAuditingPolicy
from .automatic_tuning_options import AutomaticTuningOptions
from .database_automatic_tuning import DatabaseAutomaticTuning
from .encryption_protector import EncryptionProtector
Expand Down Expand Up @@ -217,6 +219,10 @@
from .sync_member import SyncMember
from .subscription_usage import SubscriptionUsage
from .virtual_network_rule import VirtualNetworkRule
from .extended_database_blob_auditing_policy import ExtendedDatabaseBlobAuditingPolicy
from .extended_server_blob_auditing_policy import ExtendedServerBlobAuditingPolicy
from .server_blob_auditing_policy import ServerBlobAuditingPolicy
from .database_blob_auditing_policy import DatabaseBlobAuditingPolicy
from .database_vulnerability_assessment_rule_baseline_item import DatabaseVulnerabilityAssessmentRuleBaselineItem
from .database_vulnerability_assessment_rule_baseline import DatabaseVulnerabilityAssessmentRuleBaseline
from .vulnerability_assessment_recurring_scans_properties import VulnerabilityAssessmentRecurringScansProperties
Expand Down Expand Up @@ -332,6 +338,7 @@
from .elastic_pool_operation_paged import ElasticPoolOperationPaged
from .vulnerability_assessment_scan_record_paged import VulnerabilityAssessmentScanRecordPaged
from .instance_failover_group_paged import InstanceFailoverGroupPaged
from .backup_short_term_retention_policy_paged import BackupShortTermRetentionPolicyPaged
from .sql_management_client_enums import (
CheckNameAvailabilityReason,
ServerConnectionType,
Expand All @@ -357,7 +364,6 @@
RecommendedIndexType,
TransparentDataEncryptionStatus,
TransparentDataEncryptionActivityStatus,
BlobAuditingPolicyState,
AutomaticTuningMode,
AutomaticTuningOptionModeDesired,
AutomaticTuningOptionModeActual,
Expand All @@ -376,6 +382,7 @@
SyncDirection,
SyncMemberState,
VirtualNetworkRuleState,
BlobAuditingPolicyState,
JobAgentState,
JobExecutionLifecycle,
ProvisioningState,
Expand Down Expand Up @@ -451,7 +458,6 @@
'TransparentDataEncryptionActivity',
'ServerUsage',
'DatabaseUsage',
'DatabaseBlobAuditingPolicy',
'AutomaticTuningOptions',
'DatabaseAutomaticTuning',
'EncryptionProtector',
Expand Down Expand Up @@ -484,6 +490,10 @@
'SyncMember',
'SubscriptionUsage',
'VirtualNetworkRule',
'ExtendedDatabaseBlobAuditingPolicy',
'ExtendedServerBlobAuditingPolicy',
'ServerBlobAuditingPolicy',
'DatabaseBlobAuditingPolicy',
'DatabaseVulnerabilityAssessmentRuleBaselineItem',
'DatabaseVulnerabilityAssessmentRuleBaseline',
'VulnerabilityAssessmentRecurringScansProperties',
Expand Down Expand Up @@ -599,6 +609,7 @@
'ElasticPoolOperationPaged',
'VulnerabilityAssessmentScanRecordPaged',
'InstanceFailoverGroupPaged',
'BackupShortTermRetentionPolicyPaged',
'CheckNameAvailabilityReason',
'ServerConnectionType',
'SecurityAlertPolicyState',
Expand All @@ -623,7 +634,6 @@
'RecommendedIndexType',
'TransparentDataEncryptionStatus',
'TransparentDataEncryptionActivityStatus',
'BlobAuditingPolicyState',
'AutomaticTuningMode',
'AutomaticTuningOptionModeDesired',
'AutomaticTuningOptionModeActual',
Expand All @@ -642,6 +652,7 @@
'SyncDirection',
'SyncMemberState',
'VirtualNetworkRuleState',
'BlobAuditingPolicyState',
'JobAgentState',
'JobExecutionLifecycle',
'ProvisioningState',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from msrest.paging import Paged


class BackupShortTermRetentionPolicyPaged(Paged):
"""
A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy <azure.mgmt.sql.models.BackupShortTermRetentionPolicy>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[BackupShortTermRetentionPolicy]'}
}

def __init__(self, *args, **kwargs):

super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,72 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
:param retention_days: Specifies the number of days to keep in the audit
logs.
:type retention_days: int
:param audit_actions_and_groups: Specifies the Actions and Actions-Groups
:param audit_actions_and_groups: 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:
<action> ON <object> BY <principal>
Note that <object> 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::<db_name> and SCHEMA::<schema_name> 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)
:type audit_actions_and_groups: list[str]
:param storage_account_subscription_id: Specifies the blob storage
subscription Id.
:type storage_account_subscription_id: str
:param is_storage_secondary_key_in_use: Specifies whether
storageAccountAccessKey value is the storages secondary key.
storageAccountAccessKey value is the storage's secondary key.
:type is_storage_secondary_key_in_use: bool
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,72 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
:param retention_days: Specifies the number of days to keep in the audit
logs.
:type retention_days: int
:param audit_actions_and_groups: Specifies the Actions and Actions-Groups
:param audit_actions_and_groups: 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:
<action> ON <object> BY <principal>
Note that <object> 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::<db_name> and SCHEMA::<schema_name> 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)
:type audit_actions_and_groups: list[str]
:param storage_account_subscription_id: Specifies the blob storage
subscription Id.
:type storage_account_subscription_id: str
:param is_storage_secondary_key_in_use: Specifies whether
storageAccountAccessKey value is the storages secondary key.
storageAccountAccessKey value is the storage's secondary key.
:type is_storage_secondary_key_in_use: bool
"""

Expand Down
Loading

0 comments on commit 0c50434

Please sign in to comment.