Skip to content

Commit

Permalink
[AutoPR sql/resource-manager] Adding serverSecurityAlertPolicies.json…
Browse files Browse the repository at this point in the history
… from pr (#2697)

* Generated from 462e8a68d6f8e8d169a1bf4340ca64ebdbce314d

Fix validation error

* Generated from bd7ff47b3e8549566c77c4ebc7de1e86703ac29e

fixed comments

* Generated from bd7ff47b3e8549566c77c4ebc7de1e86703ac29e

fixed comments
  • Loading branch information
AutorestCI authored Jun 11, 2018
1 parent 6205793 commit bff5610
Show file tree
Hide file tree
Showing 7 changed files with 393 additions and 0 deletions.
5 changes: 5 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
from .server_automatic_tuning_py3 import ServerAutomaticTuning
from .server_dns_alias_py3 import ServerDnsAlias
from .server_dns_alias_acquisition_py3 import ServerDnsAliasAcquisition
from .server_security_alert_policy_py3 import ServerSecurityAlertPolicy
from .restore_point_py3 import RestorePoint
from .create_database_restore_point_definition_py3 import CreateDatabaseRestorePointDefinition
from .database_operation_py3 import DatabaseOperation
Expand Down Expand Up @@ -243,6 +244,7 @@
from .server_automatic_tuning import ServerAutomaticTuning
from .server_dns_alias import ServerDnsAlias
from .server_dns_alias_acquisition import ServerDnsAliasAcquisition
from .server_security_alert_policy import ServerSecurityAlertPolicy
from .restore_point import RestorePoint
from .create_database_restore_point_definition import CreateDatabaseRestorePointDefinition
from .database_operation import DatabaseOperation
Expand Down Expand Up @@ -388,6 +390,7 @@
ManagedDatabaseCreateMode,
AutomaticTuningServerMode,
AutomaticTuningServerReason,
SecurityAlertState,
RestorePointType,
ManagementOperationState,
MaxSizeUnit,
Expand Down Expand Up @@ -508,6 +511,7 @@
'ServerAutomaticTuning',
'ServerDnsAlias',
'ServerDnsAliasAcquisition',
'ServerSecurityAlertPolicy',
'RestorePoint',
'CreateDatabaseRestorePointDefinition',
'DatabaseOperation',
Expand Down Expand Up @@ -652,6 +656,7 @@
'ManagedDatabaseCreateMode',
'AutomaticTuningServerMode',
'AutomaticTuningServerReason',
'SecurityAlertState',
'RestorePointType',
'ManagementOperationState',
'MaxSizeUnit',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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 .proxy_resource import ProxyResource


class ServerSecurityAlertPolicy(ProxyResource):
"""A server security alert policy.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param state: Required. Specifies the state of the policy, whether it is
enabled or disabled. Possible values include: 'Enabled', 'Disabled'
:type state: str or ~azure.mgmt.sql.models.SecurityAlertState
:param disabled_alerts: Specifies an array of alerts that are disabled.
Allowed values are: Sql_Injection, Sql_Injection_Vulnerability,
Access_Anomaly
:type disabled_alerts: list[str]
:param email_addresses: Specifies an array of e-mail addresses to which
the alert is sent.
:type email_addresses: list[str]
:param email_account_admins: Specifies that the alert is sent to the
account administrators.
:type email_account_admins: bool
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
https://MyAccount.blob.core.windows.net). This blob storage will hold all
Threat Detection audit logs.
:type storage_endpoint: str
:param storage_account_access_key: Specifies the identifier key of the
Threat Detection audit storage account.
:type storage_account_access_key: str
:param retention_days: Specifies the number of days to keep in the Threat
Detection audit logs.
:type retention_days: int
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'state': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'SecurityAlertState'},
'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'},
'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'},
'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'},
'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'},
'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'},
'retention_days': {'key': 'properties.retentionDays', 'type': 'int'},
}

def __init__(self, **kwargs):
super(ServerSecurityAlertPolicy, self).__init__(**kwargs)
self.state = kwargs.get('state', None)
self.disabled_alerts = kwargs.get('disabled_alerts', None)
self.email_addresses = kwargs.get('email_addresses', None)
self.email_account_admins = kwargs.get('email_account_admins', None)
self.storage_endpoint = kwargs.get('storage_endpoint', None)
self.storage_account_access_key = kwargs.get('storage_account_access_key', None)
self.retention_days = kwargs.get('retention_days', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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 .proxy_resource_py3 import ProxyResource


class ServerSecurityAlertPolicy(ProxyResource):
"""A server security alert policy.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param state: Required. Specifies the state of the policy, whether it is
enabled or disabled. Possible values include: 'Enabled', 'Disabled'
:type state: str or ~azure.mgmt.sql.models.SecurityAlertState
:param disabled_alerts: Specifies an array of alerts that are disabled.
Allowed values are: Sql_Injection, Sql_Injection_Vulnerability,
Access_Anomaly
:type disabled_alerts: list[str]
:param email_addresses: Specifies an array of e-mail addresses to which
the alert is sent.
:type email_addresses: list[str]
:param email_account_admins: Specifies that the alert is sent to the
account administrators.
:type email_account_admins: bool
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
https://MyAccount.blob.core.windows.net). This blob storage will hold all
Threat Detection audit logs.
:type storage_endpoint: str
:param storage_account_access_key: Specifies the identifier key of the
Threat Detection audit storage account.
:type storage_account_access_key: str
:param retention_days: Specifies the number of days to keep in the Threat
Detection audit logs.
:type retention_days: int
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'state': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'SecurityAlertState'},
'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'},
'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'},
'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'},
'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'},
'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'},
'retention_days': {'key': 'properties.retentionDays', 'type': 'int'},
}

def __init__(self, *, state, disabled_alerts=None, email_addresses=None, email_account_admins: bool=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, **kwargs) -> None:
super(ServerSecurityAlertPolicy, self).__init__(**kwargs)
self.state = state
self.disabled_alerts = disabled_alerts
self.email_addresses = email_addresses
self.email_account_admins = email_account_admins
self.storage_endpoint = storage_endpoint
self.storage_account_access_key = storage_account_access_key
self.retention_days = retention_days
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,12 @@ class AutomaticTuningServerReason(str, Enum):
auto_configured = "AutoConfigured"


class SecurityAlertState(str, Enum):

enabled = "Enabled"
disabled = "Disabled"


class RestorePointType(str, Enum):

continuous = "CONTINUOUS"
Expand Down
2 changes: 2 additions & 0 deletions azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from .managed_databases_operations import ManagedDatabasesOperations
from .server_automatic_tuning_operations import ServerAutomaticTuningOperations
from .server_dns_aliases_operations import ServerDnsAliasesOperations
from .server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations
from .restore_points_operations import RestorePointsOperations
from .database_operations import DatabaseOperations
from .elastic_pool_operations import ElasticPoolOperations
Expand Down Expand Up @@ -120,6 +121,7 @@
'ManagedDatabasesOperations',
'ServerAutomaticTuningOperations',
'ServerDnsAliasesOperations',
'ServerSecurityAlertPoliciesOperations',
'RestorePointsOperations',
'DatabaseOperations',
'ElasticPoolOperations',
Expand Down
Loading

0 comments on commit bff5610

Please sign in to comment.