Skip to content

[AutoPR sql/resource-manager] Update BlobAuditing swaggers to support Azure Monitor audit target #3701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
:ivar kind: Resource kind.
:vartype kind: str
:param state: Required. Specifies the state of the policy. If state is
Enabled, storageEndpoint and storageAccountAccessKey are required.
Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
Possible values include: 'Enabled', 'Disabled'
:type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
https://MyAccount.blob.core.windows.net). If state is Enabled,
storageEndpoint is required.
:type storage_endpoint: str
:param storage_account_access_key: Specifies the identifier key of the
auditing storage account. If state is Enabled, storageAccountAccessKey is
required.
auditing storage account. If state is Enabled and storageEndpoint is
specified, storageAccountAccessKey is required.
:type storage_account_access_key: str
:param retention_days: Specifies the number of days to keep in the audit
logs.
logs in the storage account.
:type retention_days: int
:param audit_actions_and_groups: Specifies the Actions-Groups and Actions
to audit.
Expand Down Expand Up @@ -110,6 +110,23 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
:param is_storage_secondary_key_in_use: Specifies whether
storageAccountAccessKey value is the storage's secondary key.
:type is_storage_secondary_key_in_use: bool
:param is_azure_monitor_target_enabled: Specifies whether audit events are
sent to Azure Monitor.
In order to send the events to Azure Monitor, specify 'State' as 'Enabled'
and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with
'SQLSecurityAuditEvents' diagnostic logs category on the database should
be also created.
Note that for server level audit you should use the 'master' database as
<databaseName>.
Diagnostic Settings URI format:
PUT
https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Sql/servers/<serverName>/databases/<databaseName>/providers/microsoft.insights/diagnosticSettings/<settingsName>?api-version=2017-05-01-preview
For more information, see [Diagnostic Settings REST
API](https://go.microsoft.com/fwlink/?linkid=2033207)
or [Diagnostic Settings
PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
:type is_azure_monitor_target_enabled: bool
"""

_validation = {
Expand All @@ -132,6 +149,7 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'},
'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'},
'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'},
'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'},
}

def __init__(self, **kwargs):
Expand All @@ -144,3 +162,4 @@ def __init__(self, **kwargs):
self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None)
self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None)
self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None)
self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None)
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
:ivar kind: Resource kind.
:vartype kind: str
:param state: Required. Specifies the state of the policy. If state is
Enabled, storageEndpoint and storageAccountAccessKey are required.
Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
Possible values include: 'Enabled', 'Disabled'
:type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
https://MyAccount.blob.core.windows.net). If state is Enabled,
storageEndpoint is required.
:type storage_endpoint: str
:param storage_account_access_key: Specifies the identifier key of the
auditing storage account. If state is Enabled, storageAccountAccessKey is
required.
auditing storage account. If state is Enabled and storageEndpoint is
specified, storageAccountAccessKey is required.
:type storage_account_access_key: str
:param retention_days: Specifies the number of days to keep in the audit
logs.
logs in the storage account.
:type retention_days: int
:param audit_actions_and_groups: Specifies the Actions-Groups and Actions
to audit.
Expand Down Expand Up @@ -110,6 +110,23 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
:param is_storage_secondary_key_in_use: Specifies whether
storageAccountAccessKey value is the storage's secondary key.
:type is_storage_secondary_key_in_use: bool
:param is_azure_monitor_target_enabled: Specifies whether audit events are
sent to Azure Monitor.
In order to send the events to Azure Monitor, specify 'State' as 'Enabled'
and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with
'SQLSecurityAuditEvents' diagnostic logs category on the database should
be also created.
Note that for server level audit you should use the 'master' database as
<databaseName>.
Diagnostic Settings URI format:
PUT
https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Sql/servers/<serverName>/databases/<databaseName>/providers/microsoft.insights/diagnosticSettings/<settingsName>?api-version=2017-05-01-preview
For more information, see [Diagnostic Settings REST
API](https://go.microsoft.com/fwlink/?linkid=2033207)
or [Diagnostic Settings
PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
:type is_azure_monitor_target_enabled: bool
"""

_validation = {
Expand All @@ -132,9 +149,10 @@ class DatabaseBlobAuditingPolicy(ProxyResource):
'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'},
'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'},
'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'},
'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'},
}

def __init__(self, *, state, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, **kwargs) -> None:
def __init__(self, *, state, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, **kwargs) -> None:
super(DatabaseBlobAuditingPolicy, self).__init__(**kwargs)
self.kind = None
self.state = state
Expand All @@ -144,3 +162,4 @@ def __init__(self, *, state, storage_endpoint: str=None, storage_account_access_
self.audit_actions_and_groups = audit_actions_and_groups
self.storage_account_subscription_id = storage_account_subscription_id
self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use
self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource):
creating an audit.
:type predicate_expression: str
:param state: Required. Specifies the state of the policy. If state is
Enabled, storageEndpoint and storageAccountAccessKey are required.
Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
Possible values include: 'Enabled', 'Disabled'
:type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
https://MyAccount.blob.core.windows.net). If state is Enabled,
storageEndpoint is required.
:type storage_endpoint: str
:param storage_account_access_key: Specifies the identifier key of the
auditing storage account. If state is Enabled, storageAccountAccessKey is
required.
auditing storage account. If state is Enabled and storageEndpoint is
specified, storageAccountAccessKey is required.
:type storage_account_access_key: str
:param retention_days: Specifies the number of days to keep in the audit
logs.
logs in the storage account.
:type retention_days: int
:param audit_actions_and_groups: Specifies the Actions-Groups and Actions
to audit.
Expand Down Expand Up @@ -111,6 +111,23 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource):
:param is_storage_secondary_key_in_use: Specifies whether
storageAccountAccessKey value is the storage's secondary key.
:type is_storage_secondary_key_in_use: bool
:param is_azure_monitor_target_enabled: Specifies whether audit events are
sent to Azure Monitor.
In order to send the events to Azure Monitor, specify 'State' as 'Enabled'
and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with
'SQLSecurityAuditEvents' diagnostic logs category on the database should
be also created.
Note that for server level audit you should use the 'master' database as
<databaseName>.
Diagnostic Settings URI format:
PUT
https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Sql/servers/<serverName>/databases/<databaseName>/providers/microsoft.insights/diagnosticSettings/<settingsName>?api-version=2017-05-01-preview
For more information, see [Diagnostic Settings REST
API](https://go.microsoft.com/fwlink/?linkid=2033207)
or [Diagnostic Settings
PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
:type is_azure_monitor_target_enabled: bool
"""

_validation = {
Expand All @@ -132,6 +149,7 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource):
'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'},
'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'},
'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'},
'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'},
}

def __init__(self, **kwargs):
Expand All @@ -144,3 +162,4 @@ def __init__(self, **kwargs):
self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None)
self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None)
self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None)
self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None)
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource):
creating an audit.
:type predicate_expression: str
:param state: Required. Specifies the state of the policy. If state is
Enabled, storageEndpoint and storageAccountAccessKey are required.
Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
Possible values include: 'Enabled', 'Disabled'
:type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
https://MyAccount.blob.core.windows.net). If state is Enabled,
storageEndpoint is required.
:type storage_endpoint: str
:param storage_account_access_key: Specifies the identifier key of the
auditing storage account. If state is Enabled, storageAccountAccessKey is
required.
auditing storage account. If state is Enabled and storageEndpoint is
specified, storageAccountAccessKey is required.
:type storage_account_access_key: str
:param retention_days: Specifies the number of days to keep in the audit
logs.
logs in the storage account.
:type retention_days: int
:param audit_actions_and_groups: Specifies the Actions-Groups and Actions
to audit.
Expand Down Expand Up @@ -111,6 +111,23 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource):
:param is_storage_secondary_key_in_use: Specifies whether
storageAccountAccessKey value is the storage's secondary key.
:type is_storage_secondary_key_in_use: bool
:param is_azure_monitor_target_enabled: Specifies whether audit events are
sent to Azure Monitor.
In order to send the events to Azure Monitor, specify 'State' as 'Enabled'
and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with
'SQLSecurityAuditEvents' diagnostic logs category on the database should
be also created.
Note that for server level audit you should use the 'master' database as
<databaseName>.
Diagnostic Settings URI format:
PUT
https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Sql/servers/<serverName>/databases/<databaseName>/providers/microsoft.insights/diagnosticSettings/<settingsName>?api-version=2017-05-01-preview
For more information, see [Diagnostic Settings REST
API](https://go.microsoft.com/fwlink/?linkid=2033207)
or [Diagnostic Settings
PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
:type is_azure_monitor_target_enabled: bool
"""

_validation = {
Expand All @@ -132,9 +149,10 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource):
'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'},
'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'},
'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'},
'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'},
}

def __init__(self, *, state, predicate_expression: str=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, **kwargs) -> None:
def __init__(self, *, state, predicate_expression: str=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, **kwargs) -> None:
super(ExtendedDatabaseBlobAuditingPolicy, self).__init__(**kwargs)
self.predicate_expression = predicate_expression
self.state = state
Expand All @@ -144,3 +162,4 @@ def __init__(self, *, state, predicate_expression: str=None, storage_endpoint: s
self.audit_actions_and_groups = audit_actions_and_groups
self.storage_account_subscription_id = storage_account_subscription_id
self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use
self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource):
creating an audit.
:type predicate_expression: str
:param state: Required. Specifies the state of the policy. If state is
Enabled, storageEndpoint and storageAccountAccessKey are required.
Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required.
Possible values include: 'Enabled', 'Disabled'
:type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
https://MyAccount.blob.core.windows.net). If state is Enabled,
storageEndpoint is required.
:type storage_endpoint: str
:param storage_account_access_key: Specifies the identifier key of the
auditing storage account. If state is Enabled, storageAccountAccessKey is
required.
auditing storage account. If state is Enabled and storageEndpoint is
specified, storageAccountAccessKey is required.
:type storage_account_access_key: str
:param retention_days: Specifies the number of days to keep in the audit
logs.
logs in the storage account.
:type retention_days: int
:param audit_actions_and_groups: Specifies the Actions-Groups and Actions
to audit.
Expand Down Expand Up @@ -111,6 +111,23 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource):
:param is_storage_secondary_key_in_use: Specifies whether
storageAccountAccessKey value is the storage's secondary key.
:type is_storage_secondary_key_in_use: bool
:param is_azure_monitor_target_enabled: Specifies whether audit events are
sent to Azure Monitor.
In order to send the events to Azure Monitor, specify 'State' as 'Enabled'
and 'IsAzureMonitorTargetEnabled' as true.
When using REST API to configure auditing, Diagnostic Settings with
'SQLSecurityAuditEvents' diagnostic logs category on the database should
be also created.
Note that for server level audit you should use the 'master' database as
<databaseName>.
Diagnostic Settings URI format:
PUT
https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.Sql/servers/<serverName>/databases/<databaseName>/providers/microsoft.insights/diagnosticSettings/<settingsName>?api-version=2017-05-01-preview
For more information, see [Diagnostic Settings REST
API](https://go.microsoft.com/fwlink/?linkid=2033207)
or [Diagnostic Settings
PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
:type is_azure_monitor_target_enabled: bool
"""

_validation = {
Expand All @@ -132,6 +149,7 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource):
'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'},
'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'},
'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'},
'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'},
}

def __init__(self, **kwargs):
Expand All @@ -144,3 +162,4 @@ def __init__(self, **kwargs):
self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None)
self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None)
self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None)
self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None)
Loading