Skip to content

Commit 0f759c6

Browse files
authored
Generated from a82909eab07e7a383975701b09d09a5fd0dfb967 (#2751)
adding new state value to keep backward competiblity adding new state value to keep backward competiblity
1 parent a393fa9 commit 0f759c6

6 files changed

+385
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
from .server_automatic_tuning_py3 import ServerAutomaticTuning
112112
from .server_dns_alias_py3 import ServerDnsAlias
113113
from .server_dns_alias_acquisition_py3 import ServerDnsAliasAcquisition
114+
from .server_security_alert_policy_py3 import ServerSecurityAlertPolicy
114115
from .restore_point_py3 import RestorePoint
115116
from .create_database_restore_point_definition_py3 import CreateDatabaseRestorePointDefinition
116117
from .database_operation_py3 import DatabaseOperation
@@ -249,6 +250,7 @@
249250
from .server_automatic_tuning import ServerAutomaticTuning
250251
from .server_dns_alias import ServerDnsAlias
251252
from .server_dns_alias_acquisition import ServerDnsAliasAcquisition
253+
from .server_security_alert_policy import ServerSecurityAlertPolicy
252254
from .restore_point import RestorePoint
253255
from .create_database_restore_point_definition import CreateDatabaseRestorePointDefinition
254256
from .database_operation import DatabaseOperation
@@ -518,6 +520,7 @@
518520
'ServerAutomaticTuning',
519521
'ServerDnsAlias',
520522
'ServerDnsAliasAcquisition',
523+
'ServerSecurityAlertPolicy',
521524
'RestorePoint',
522525
'CreateDatabaseRestorePointDefinition',
523526
'DatabaseOperation',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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 .proxy_resource import ProxyResource
13+
14+
15+
class ServerSecurityAlertPolicy(ProxyResource):
16+
"""A server security alert policy.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
All required parameters must be populated in order to send to Azure.
22+
23+
:ivar id: Resource ID.
24+
:vartype id: str
25+
:ivar name: Resource name.
26+
:vartype name: str
27+
:ivar type: Resource type.
28+
:vartype type: str
29+
:param state: Required. Specifies the state of the policy, whether it is
30+
enabled or disabled. Possible values include: 'New', 'Enabled', 'Disabled'
31+
:type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState
32+
:param disabled_alerts: Specifies an array of alerts that are disabled.
33+
Allowed values are: Sql_Injection, Sql_Injection_Vulnerability,
34+
Access_Anomaly
35+
:type disabled_alerts: list[str]
36+
:param email_addresses: Specifies an array of e-mail addresses to which
37+
the alert is sent.
38+
:type email_addresses: list[str]
39+
:param email_account_admins: Specifies that the alert is sent to the
40+
account administrators.
41+
:type email_account_admins: bool
42+
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
43+
https://MyAccount.blob.core.windows.net). This blob storage will hold all
44+
Threat Detection audit logs.
45+
:type storage_endpoint: str
46+
:param storage_account_access_key: Specifies the identifier key of the
47+
Threat Detection audit storage account.
48+
:type storage_account_access_key: str
49+
:param retention_days: Specifies the number of days to keep in the Threat
50+
Detection audit logs.
51+
:type retention_days: int
52+
"""
53+
54+
_validation = {
55+
'id': {'readonly': True},
56+
'name': {'readonly': True},
57+
'type': {'readonly': True},
58+
'state': {'required': True},
59+
}
60+
61+
_attribute_map = {
62+
'id': {'key': 'id', 'type': 'str'},
63+
'name': {'key': 'name', 'type': 'str'},
64+
'type': {'key': 'type', 'type': 'str'},
65+
'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'},
66+
'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'},
67+
'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'},
68+
'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'},
69+
'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'},
70+
'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'},
71+
'retention_days': {'key': 'properties.retentionDays', 'type': 'int'},
72+
}
73+
74+
def __init__(self, **kwargs):
75+
super(ServerSecurityAlertPolicy, self).__init__(**kwargs)
76+
self.state = kwargs.get('state', None)
77+
self.disabled_alerts = kwargs.get('disabled_alerts', None)
78+
self.email_addresses = kwargs.get('email_addresses', None)
79+
self.email_account_admins = kwargs.get('email_account_admins', None)
80+
self.storage_endpoint = kwargs.get('storage_endpoint', None)
81+
self.storage_account_access_key = kwargs.get('storage_account_access_key', None)
82+
self.retention_days = kwargs.get('retention_days', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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 .proxy_resource_py3 import ProxyResource
13+
14+
15+
class ServerSecurityAlertPolicy(ProxyResource):
16+
"""A server security alert policy.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
All required parameters must be populated in order to send to Azure.
22+
23+
:ivar id: Resource ID.
24+
:vartype id: str
25+
:ivar name: Resource name.
26+
:vartype name: str
27+
:ivar type: Resource type.
28+
:vartype type: str
29+
:param state: Required. Specifies the state of the policy, whether it is
30+
enabled or disabled. Possible values include: 'New', 'Enabled', 'Disabled'
31+
:type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState
32+
:param disabled_alerts: Specifies an array of alerts that are disabled.
33+
Allowed values are: Sql_Injection, Sql_Injection_Vulnerability,
34+
Access_Anomaly
35+
:type disabled_alerts: list[str]
36+
:param email_addresses: Specifies an array of e-mail addresses to which
37+
the alert is sent.
38+
:type email_addresses: list[str]
39+
:param email_account_admins: Specifies that the alert is sent to the
40+
account administrators.
41+
:type email_account_admins: bool
42+
:param storage_endpoint: Specifies the blob storage endpoint (e.g.
43+
https://MyAccount.blob.core.windows.net). This blob storage will hold all
44+
Threat Detection audit logs.
45+
:type storage_endpoint: str
46+
:param storage_account_access_key: Specifies the identifier key of the
47+
Threat Detection audit storage account.
48+
:type storage_account_access_key: str
49+
:param retention_days: Specifies the number of days to keep in the Threat
50+
Detection audit logs.
51+
:type retention_days: int
52+
"""
53+
54+
_validation = {
55+
'id': {'readonly': True},
56+
'name': {'readonly': True},
57+
'type': {'readonly': True},
58+
'state': {'required': True},
59+
}
60+
61+
_attribute_map = {
62+
'id': {'key': 'id', 'type': 'str'},
63+
'name': {'key': 'name', 'type': 'str'},
64+
'type': {'key': 'type', 'type': 'str'},
65+
'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'},
66+
'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'},
67+
'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'},
68+
'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'},
69+
'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'},
70+
'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'},
71+
'retention_days': {'key': 'properties.retentionDays', 'type': 'int'},
72+
}
73+
74+
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:
75+
super(ServerSecurityAlertPolicy, self).__init__(**kwargs)
76+
self.state = state
77+
self.disabled_alerts = disabled_alerts
78+
self.email_addresses = email_addresses
79+
self.email_account_admins = email_account_admins
80+
self.storage_endpoint = storage_endpoint
81+
self.storage_account_access_key = storage_account_access_key
82+
self.retention_days = retention_days

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

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
from .managed_databases_operations import ManagedDatabasesOperations
6464
from .server_automatic_tuning_operations import ServerAutomaticTuningOperations
6565
from .server_dns_aliases_operations import ServerDnsAliasesOperations
66+
from .server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations
6667
from .restore_points_operations import RestorePointsOperations
6768
from .database_operations import DatabaseOperations
6869
from .elastic_pool_operations import ElasticPoolOperations
@@ -126,6 +127,7 @@
126127
'ManagedDatabasesOperations',
127128
'ServerAutomaticTuningOperations',
128129
'ServerDnsAliasesOperations',
130+
'ServerSecurityAlertPoliciesOperations',
129131
'RestorePointsOperations',
130132
'DatabaseOperations',
131133
'ElasticPoolOperations',

0 commit comments

Comments
 (0)