Skip to content
Open
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 @@ -23,11 +23,11 @@
from .operations import ServerAdministratorsOperations
from .operations import LocationBasedPerformanceTierOperations
from .operations import CheckNameAvailabilityOperations
from .operations import ServerSecurityAlertPoliciesOperations
from .operations import Operations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .operations import ServerKeysOperations
from .operations import ServerSecurityAlertPoliciesOperations
from . import models


Expand Down Expand Up @@ -57,8 +57,6 @@ class PostgreSQLManagementClient(SDKClient):
:vartype location_based_performance_tier: azure.mgmt.rdbms.postgresql.operations.LocationBasedPerformanceTierOperations
:ivar check_name_availability: CheckNameAvailability operations
:vartype check_name_availability: azure.mgmt.rdbms.postgresql.operations.CheckNameAvailabilityOperations
:ivar server_security_alert_policies: ServerSecurityAlertPolicies operations
:vartype server_security_alert_policies: azure.mgmt.rdbms.postgresql.operations.ServerSecurityAlertPoliciesOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.rdbms.postgresql.operations.Operations
:ivar private_endpoint_connections: PrivateEndpointConnections operations
Expand All @@ -67,6 +65,8 @@ class PostgreSQLManagementClient(SDKClient):
:vartype private_link_resources: azure.mgmt.rdbms.postgresql.operations.PrivateLinkResourcesOperations
:ivar server_keys: ServerKeys operations
:vartype server_keys: azure.mgmt.rdbms.postgresql.operations.ServerKeysOperations
:ivar server_security_alert_policies: ServerSecurityAlertPolicies operations
:vartype server_security_alert_policies: azure.mgmt.rdbms.postgresql.operations.ServerSecurityAlertPoliciesOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand Down Expand Up @@ -106,8 +106,6 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.check_name_availability = CheckNameAvailabilityOperations(
self._client, self.config, self._serialize, self._deserialize)
self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
Expand All @@ -116,3 +114,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.server_keys = ServerKeysOperations(
self._client, self.config, self._serialize, self._deserialize)
self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from ._models_py3 import ServerUpdateParameters
from ._models_py3 import Sku
from ._models_py3 import StorageProfile
from ._models_py3 import SystemData
from ._models_py3 import TagsObject
from ._models_py3 import TrackedResource
from ._models_py3 import VirtualNetworkRule
Expand Down Expand Up @@ -90,6 +91,7 @@
from ._models import ServerUpdateParameters
from ._models import Sku
from ._models import StorageProfile
from ._models import SystemData
from ._models import TagsObject
from ._models import TrackedResource
from ._models import VirtualNetworkRule
Expand All @@ -103,6 +105,7 @@
from ._paged_models import ServerAdministratorResourcePaged
from ._paged_models import ServerKeyPaged
from ._paged_models import ServerPaged
from ._paged_models import ServerSecurityAlertPolicyPaged
from ._paged_models import VirtualNetworkRulePaged
from ._postgre_sql_management_client_enums import (
ServerVersion,
Expand All @@ -121,6 +124,7 @@
VirtualNetworkRuleState,
OperationOrigin,
ServerSecurityAlertPolicyState,
CreatedByType,
)

__all__ = [
Expand Down Expand Up @@ -162,6 +166,7 @@
'ServerUpdateParameters',
'Sku',
'StorageProfile',
'SystemData',
'TagsObject',
'TrackedResource',
'VirtualNetworkRule',
Expand All @@ -176,6 +181,7 @@
'PrivateEndpointConnectionPaged',
'PrivateLinkResourcePaged',
'ServerKeyPaged',
'ServerSecurityAlertPolicyPaged',
'ServerVersion',
'SslEnforcementEnum',
'MinimalTlsVersionEnum',
Expand All @@ -192,4 +198,5 @@
'VirtualNetworkRuleState',
'OperationOrigin',
'ServerSecurityAlertPolicyState',
'CreatedByType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -1601,57 +1601,30 @@ class ServerSecurityAlertPolicy(ProxyResource):
enabled or disabled. Possible values include: 'Enabled', 'Disabled'
:type state: str or
~azure.mgmt.rdbms.postgresql.models.ServerSecurityAlertPolicyState
: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
:ivar system_data:
:vartype system_data: ~azure.mgmt.rdbms.postgresql.models.SystemData
"""

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

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'ServerSecurityAlertPolicyState'},
'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'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
}

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)
self.system_data = None


class ServerUpdateParameters(Model):
Expand Down Expand Up @@ -1787,6 +1760,48 @@ def __init__(self, **kwargs):
self.storage_autogrow = kwargs.get('storage_autogrow', None)


class SystemData(Model):
"""Metadata pertaining to creation and last modification of the resource.

:param created_by: The identity that created the resource.
:type created_by: str
:param created_by_type: The type of identity that created the resource.
Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
:type created_by_type: str or
~azure.mgmt.rdbms.postgresql.models.CreatedByType
:param created_at: The timestamp of resource creation (UTC).
:type created_at: datetime
:param last_modified_by: The identity that last modified the resource.
:type last_modified_by: str
:param last_modified_by_type: The type of identity that last modified the
resource. Possible values include: 'User', 'Application',
'ManagedIdentity', 'Key'
:type last_modified_by_type: str or
~azure.mgmt.rdbms.postgresql.models.CreatedByType
:param last_modified_at: The type of identity that last modified the
resource.
:type last_modified_at: datetime
"""

_attribute_map = {
'created_by': {'key': 'createdBy', 'type': 'str'},
'created_by_type': {'key': 'createdByType', 'type': 'str'},
'created_at': {'key': 'createdAt', 'type': 'iso-8601'},
'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'},
'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'},
'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'},
}

def __init__(self, **kwargs):
super(SystemData, self).__init__(**kwargs)
self.created_by = kwargs.get('created_by', None)
self.created_by_type = kwargs.get('created_by_type', None)
self.created_at = kwargs.get('created_at', None)
self.last_modified_by = kwargs.get('last_modified_by', None)
self.last_modified_by_type = kwargs.get('last_modified_by_type', None)
self.last_modified_at = kwargs.get('last_modified_at', None)


class TagsObject(Model):
"""Tags object for patch operations.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1601,57 +1601,30 @@ class ServerSecurityAlertPolicy(ProxyResource):
enabled or disabled. Possible values include: 'Enabled', 'Disabled'
:type state: str or
~azure.mgmt.rdbms.postgresql.models.ServerSecurityAlertPolicyState
: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
:ivar system_data:
:vartype system_data: ~azure.mgmt.rdbms.postgresql.models.SystemData
"""

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

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'ServerSecurityAlertPolicyState'},
'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'},
'system_data': {'key': 'systemData', 'type': 'SystemData'},
}

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:
def __init__(self, *, state, **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
self.system_data = None


class ServerUpdateParameters(Model):
Expand Down Expand Up @@ -1787,6 +1760,48 @@ def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None
self.storage_autogrow = storage_autogrow


class SystemData(Model):
"""Metadata pertaining to creation and last modification of the resource.

:param created_by: The identity that created the resource.
:type created_by: str
:param created_by_type: The type of identity that created the resource.
Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
:type created_by_type: str or
~azure.mgmt.rdbms.postgresql.models.CreatedByType
:param created_at: The timestamp of resource creation (UTC).
:type created_at: datetime
:param last_modified_by: The identity that last modified the resource.
:type last_modified_by: str
:param last_modified_by_type: The type of identity that last modified the
resource. Possible values include: 'User', 'Application',
'ManagedIdentity', 'Key'
:type last_modified_by_type: str or
~azure.mgmt.rdbms.postgresql.models.CreatedByType
:param last_modified_at: The type of identity that last modified the
resource.
:type last_modified_at: datetime
"""

_attribute_map = {
'created_by': {'key': 'createdBy', 'type': 'str'},
'created_by_type': {'key': 'createdByType', 'type': 'str'},
'created_at': {'key': 'createdAt', 'type': 'iso-8601'},
'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'},
'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'},
'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'},
}

def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None:
super(SystemData, self).__init__(**kwargs)
self.created_by = created_by
self.created_by_type = created_by_type
self.created_at = created_at
self.last_modified_by = last_modified_by
self.last_modified_by_type = last_modified_by_type
self.last_modified_at = last_modified_at


class TagsObject(Model):
"""Tags object for patch operations.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,16 @@ class ServerKeyPaged(Paged):
def __init__(self, *args, **kwargs):

super(ServerKeyPaged, self).__init__(*args, **kwargs)
class ServerSecurityAlertPolicyPaged(Paged):
"""
A paging container for iterating over a list of :class:`ServerSecurityAlertPolicy <azure.mgmt.rdbms.postgresql.models.ServerSecurityAlertPolicy>` object
"""

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

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

super(ServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class MinimalTlsVersionEnum(str, Enum):

class InfrastructureEncryption(str, Enum):

enabled = "Enabled"
disabled = "Disabled"
enabled = "Enabled" #: Default value for single layer of encryption for data at rest.
disabled = "Disabled" #: Additional (2nd) layer of encryption for data at rest


class PublicNetworkAccessEnum(str, Enum):
Expand Down Expand Up @@ -122,3 +122,11 @@ class ServerSecurityAlertPolicyState(str, Enum):

enabled = "Enabled"
disabled = "Disabled"


class CreatedByType(str, Enum):

user = "User"
application = "Application"
managed_identity = "ManagedIdentity"
key = "Key"
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
from ._server_administrators_operations import ServerAdministratorsOperations
from ._location_based_performance_tier_operations import LocationBasedPerformanceTierOperations
from ._check_name_availability_operations import CheckNameAvailabilityOperations
from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations
from ._operations import Operations
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
from ._private_link_resources_operations import PrivateLinkResourcesOperations
from ._server_keys_operations import ServerKeysOperations
from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations

__all__ = [
'ServersOperations',
Expand All @@ -36,9 +36,9 @@
'ServerAdministratorsOperations',
'LocationBasedPerformanceTierOperations',
'CheckNameAvailabilityOperations',
'ServerSecurityAlertPoliciesOperations',
'Operations',
'PrivateEndpointConnectionsOperations',
'PrivateLinkResourcesOperations',
'ServerKeysOperations',
'ServerSecurityAlertPoliciesOperations',
]
Loading