diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/__init__.py new file mode 100644 index 000000000000..f413739353d4 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import MicrosoftPostgreSQLHyperscaleConfiguration +from ._microsoft_postgre_sql_hyperscale import MicrosoftPostgreSQLHyperscale +__all__ = ['MicrosoftPostgreSQLHyperscale', 'MicrosoftPostgreSQLHyperscaleConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_configuration.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_configuration.py new file mode 100644 index 000000000000..18a4b835fa4f --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class MicrosoftPostgreSQLHyperscaleConfiguration(AzureConfiguration): + """Configuration for MicrosoftPostgreSQLHyperscale + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(MicrosoftPostgreSQLHyperscaleConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-rdbms/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_microsoft_postgre_sql_hyperscale.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_microsoft_postgre_sql_hyperscale.py new file mode 100644 index 000000000000..803f04f59ba9 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_microsoft_postgre_sql_hyperscale.py @@ -0,0 +1,74 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import MicrosoftPostgreSQLHyperscaleConfiguration +from .operations import ServerGroupsOperations +from .operations import ServersOperations +from .operations import ConfigurationsOperations +from .operations import FirewallRulesOperations +from .operations import RolesOperations +from .operations import Operations +from . import models + + +class MicrosoftPostgreSQLHyperscale(SDKClient): + """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL Hyperscale (Citus) resources including server groups, servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations. + + :ivar config: Configuration for client. + :vartype config: MicrosoftPostgreSQLHyperscaleConfiguration + + :ivar server_groups: ServerGroups operations + :vartype server_groups: azure.mgmt.rdbms.postgresqlhsc.operations.ServerGroupsOperations + :ivar servers: Servers operations + :vartype servers: azure.mgmt.rdbms.postgresqlhsc.operations.ServersOperations + :ivar configurations: Configurations operations + :vartype configurations: azure.mgmt.rdbms.postgresqlhsc.operations.ConfigurationsOperations + :ivar firewall_rules: FirewallRules operations + :vartype firewall_rules: azure.mgmt.rdbms.postgresqlhsc.operations.FirewallRulesOperations + :ivar roles: Roles operations + :vartype roles: azure.mgmt.rdbms.postgresqlhsc.operations.RolesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.rdbms.postgresqlhsc.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MicrosoftPostgreSQLHyperscaleConfiguration(credentials, subscription_id, base_url) + super(MicrosoftPostgreSQLHyperscale, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2020-10-05-privatepreview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.server_groups = ServerGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.servers = ServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.configurations = ConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.roles = RolesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/__init__.py new file mode 100644 index 000000000000..48685ad4dede --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/__init__.py @@ -0,0 +1,120 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AzureEntityResource + from ._models_py3 import FirewallRule + from ._models_py3 import MaintenanceWindow + from ._models_py3 import NameAvailability + from ._models_py3 import NameAvailabilityRequest + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import Role + from ._models_py3 import ServerConfiguration + from ._models_py3 import ServerGroup + from ._models_py3 import ServerGroupConfiguration + from ._models_py3 import ServerGroupForUpdate + from ._models_py3 import ServerGroupPropertiesDelegatedSubnetArguments + from ._models_py3 import ServerGroupServer + from ._models_py3 import ServerNameItem + from ._models_py3 import ServerProperties + from ._models_py3 import ServerRoleGroup + from ._models_py3 import ServerRoleGroupConfiguration + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource +except (SyntaxError, ImportError): + from ._models import AzureEntityResource + from ._models import FirewallRule + from ._models import MaintenanceWindow + from ._models import NameAvailability + from ._models import NameAvailabilityRequest + from ._models import Operation + from ._models import OperationDisplay + from ._models import ProxyResource + from ._models import Resource + from ._models import Role + from ._models import ServerConfiguration + from ._models import ServerGroup + from ._models import ServerGroupConfiguration + from ._models import ServerGroupForUpdate + from ._models import ServerGroupPropertiesDelegatedSubnetArguments + from ._models import ServerGroupServer + from ._models import ServerNameItem + from ._models import ServerProperties + from ._models import ServerRoleGroup + from ._models import ServerRoleGroupConfiguration + from ._models import SystemData + from ._models import TrackedResource +from ._paged_models import FirewallRulePaged +from ._paged_models import OperationPaged +from ._paged_models import RolePaged +from ._paged_models import ServerConfigurationPaged +from ._paged_models import ServerGroupConfigurationPaged +from ._paged_models import ServerGroupPaged +from ._paged_models import ServerGroupServerPaged +from ._microsoft_postgre_sql_hyperscale_enums import ( + PostgreSQLVersion, + CitusVersion, + ServerState, + ServerHaState, + ServerRole, + ServerEdition, + CreatedByType, + CreateMode, + ResourceProviderType, + ConfigurationDataType, + OperationOrigin, +) + +__all__ = [ + 'AzureEntityResource', + 'FirewallRule', + 'MaintenanceWindow', + 'NameAvailability', + 'NameAvailabilityRequest', + 'Operation', + 'OperationDisplay', + 'ProxyResource', + 'Resource', + 'Role', + 'ServerConfiguration', + 'ServerGroup', + 'ServerGroupConfiguration', + 'ServerGroupForUpdate', + 'ServerGroupPropertiesDelegatedSubnetArguments', + 'ServerGroupServer', + 'ServerNameItem', + 'ServerProperties', + 'ServerRoleGroup', + 'ServerRoleGroupConfiguration', + 'SystemData', + 'TrackedResource', + 'ServerGroupPaged', + 'ServerGroupServerPaged', + 'ServerConfigurationPaged', + 'ServerGroupConfigurationPaged', + 'FirewallRulePaged', + 'RolePaged', + 'OperationPaged', + 'PostgreSQLVersion', + 'CitusVersion', + 'ServerState', + 'ServerHaState', + 'ServerRole', + 'ServerEdition', + 'CreatedByType', + 'CreateMode', + 'ResourceProviderType', + 'ConfigurationDataType', + 'OperationOrigin', +] diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_microsoft_postgre_sql_hyperscale_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_microsoft_postgre_sql_hyperscale_enums.py new file mode 100644 index 000000000000..ca9198802530 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_microsoft_postgre_sql_hyperscale_enums.py @@ -0,0 +1,99 @@ +# 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 enum import Enum + + +class PostgreSQLVersion(str, Enum): + + one_one = "11" + one_two = "12" + + +class CitusVersion(str, Enum): + + eight_full_stop_three = "8.3" + nine_full_stop_zero = "9.0" + nine_full_stop_one = "9.1" + nine_full_stop_two = "9.2" + nine_full_stop_three = "9.3" + nine_full_stop_four = "9.4" + nine_full_stop_five = "9.5" + + +class ServerState(str, Enum): + + ready = "Ready" + dropping = "Dropping" + disabled = "Disabled" + starting = "Starting" + stopping = "Stopping" + stopped = "Stopped" + updating = "Updating" + provisioning = "Provisioning" + + +class ServerHaState(str, Enum): + + not_enabled = "NotEnabled" + creating_standby = "CreatingStandby" + replicating_data = "ReplicatingData" + failing_over = "FailingOver" + healthy = "Healthy" + removing_standby = "RemovingStandby" + not_sync = "NotSync" + + +class ServerRole(str, Enum): + + coordinator = "Coordinator" + worker = "Worker" + + +class ServerEdition(str, Enum): + + general_purpose = "GeneralPurpose" + memory_optimized = "MemoryOptimized" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class CreateMode(str, Enum): + + default = "Default" + point_in_time_restore = "PointInTimeRestore" + + +class ResourceProviderType(str, Enum): + + meru = "Meru" + marlin = "Marlin" + + +class ConfigurationDataType(str, Enum): + + boolean = "Boolean" + numeric = "Numeric" + integer = "Integer" + enumeration = "Enumeration" + + +class OperationOrigin(str, Enum): + + not_specified = "NotSpecified" + user = "user" + system = "system" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_models.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_models.py new file mode 100644 index 000000000000..f78a4f5aedfb --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_models.py @@ -0,0 +1,1186 @@ +# 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.serialization import Model +from msrest.exceptions import HttpOperationError + + +class Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """An error response from the Batch service. + + :param error: The error. + :type error: ~azure.mgmt.rdbms.postgresqlhsc.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Batch service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.rdbms.postgresqlhsc.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class FirewallRule(ProxyResource): + """Represents a server group firewall rule. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param start_ip_address: Required. The start IP address of the server + group firewall rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: Required. The end IP address of the server group + firewall rule. Must be IPv4 format. + :type end_ip_address: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + 'end_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FirewallRule, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.start_ip_address = kwargs.get('start_ip_address', None) + self.end_ip_address = kwargs.get('end_ip_address', None) + + +class MaintenanceWindow(Model): + """Maintenance window of a server group. + + :param custom_window: indicates whether custom window is enabled or + disabled + :type custom_window: str + :param start_hour: start hour for maintenance window + :type start_hour: int + :param start_minute: start minute for maintenance window + :type start_minute: int + :param day_of_week: day of week for maintenance window + :type day_of_week: int + """ + + _attribute_map = { + 'custom_window': {'key': 'customWindow', 'type': 'str'}, + 'start_hour': {'key': 'startHour', 'type': 'int'}, + 'start_minute': {'key': 'startMinute', 'type': 'int'}, + 'day_of_week': {'key': 'dayOfWeek', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(MaintenanceWindow, self).__init__(**kwargs) + self.custom_window = kwargs.get('custom_window', None) + self.start_hour = kwargs.get('start_hour', None) + self.start_minute = kwargs.get('start_minute', None) + self.day_of_week = kwargs.get('day_of_week', None) + + +class NameAvailability(Model): + """Represents a resource name availability. + + :param message: Error Message. + :type message: str + :param name_available: Indicates whether the resource name is available. + :type name_available: bool + :param name: name of the PostgreSQL server. + :type name: str + :param type: type of the server + :type type: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailability, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.name_available = kwargs.get('name_available', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class NameAvailabilityRequest(Model): + """Request from client to check resource name availability. + + 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. + + :param name: Required. Resource name to verify. + :type name: str + :ivar type: Required. Resource type used for verification. Default value: + "Microsoft.DBforPostgreSQL/serverGroupsv2" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.DBforPostgreSQL/serverGroupsv2" + + def __init__(self, **kwargs): + super(NameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class Operation(Model): + """REST API operation definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: The localized display information for this particular + operation or action. + :vartype display: ~azure.mgmt.rdbms.postgresqlhsc.models.OperationDisplay + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :ivar origin: The intended executor of the operation. Possible values + include: 'NotSpecified', 'user', 'system' + :vartype origin: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.OperationOrigin + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, object] + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'origin': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + self.is_data_action = kwargs.get('is_data_action', None) + self.origin = None + self.properties = None + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Operation resource provider name. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Localized friendly name for the operation. + :vartype operation: str + :ivar description: Operation description. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class Role(ProxyResource): + """Represents a server group role. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param password: Required. The password of the server group role. + :type password: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Role, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.password = kwargs.get('password', None) + + +class ServerConfiguration(ProxyResource): + """Represents a configuration. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param value: Required. Value of the configuration. + :type value: str + :ivar source: Source of the configuration. + :vartype source: str + :ivar description: Description of the configuration. + :vartype description: str + :ivar default_value: Default value of the configuration. + :vartype default_value: str + :ivar data_type: Data type of the configuration. Possible values include: + 'Boolean', 'Numeric', 'Integer', 'Enumeration' + :vartype data_type: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ConfigurationDataType + :ivar allowed_values: Allowed values of the configuration. + :vartype allowed_values: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'value': {'required': True}, + 'source': {'readonly': True}, + 'description': {'readonly': True}, + 'default_value': {'readonly': True}, + 'data_type': {'readonly': True}, + 'allowed_values': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, + 'data_type': {'key': 'properties.dataType', 'type': 'str'}, + 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerConfiguration, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.value = kwargs.get('value', None) + self.source = None + self.description = None + self.default_value = None + self.data_type = None + self.allowed_values = None + + +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class ServerGroup(TrackedResource): + """Represents a server group for create. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param create_mode: The mode to create a new server group. Possible values + include: 'Default', 'PointInTimeRestore' + :type create_mode: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CreateMode + :param administrator_login: The administrator's login name of servers in + server group. Can only be specified when the server is being created (and + is required for creation). + :type administrator_login: str + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + :param backup_retention_days: The backup retention days for server group. + :type backup_retention_days: int + :param postgresql_version: The PostgreSQL version of server group. + Possible values include: '11', '12' + :type postgresql_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.PostgreSQLVersion + :param citus_version: The Citus version of server group. Possible values + include: '8.3', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5' + :type citus_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CitusVersion + :param enable_mx: If Citus MX is enabled or not for the server group. + :type enable_mx: bool + :param enable_zfs: If ZFS compression is enabled or not for the server + group. + :type enable_zfs: bool + :param enable_shards_on_coordinator: If shards on coordinator is enabled + or not for the server group. + :type enable_shards_on_coordinator: bool + :param state: A state of a server group that is visible to user. Possible + values include: 'Ready', 'Dropping', 'Disabled', 'Starting', 'Stopping', + 'Stopped', 'Updating', 'Provisioning' + :type state: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerState + :ivar earliest_restore_time: The earliest restore point time (ISO8601 + format) for server group. + :vartype earliest_restore_time: datetime + :ivar resource_provider_type: The resource provider type of server group. + Possible values include: 'Meru', 'Marlin' + :vartype resource_provider_type: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ResourceProviderType + :param server_role_groups: The list of server role groups. + :type server_role_groups: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerRoleGroup] + :param maintenance_window: Maintenance window of a server group. + :type maintenance_window: + ~azure.mgmt.rdbms.postgresqlhsc.models.MaintenanceWindow + :param availability_zone: Availability Zone information of the server + group. + :type availability_zone: str + :param standby_availability_zone: Standby Availability Zone information of + the server group. + :type standby_availability_zone: str + :param delegated_subnet_arguments: The delegated subnet arguments for a + server group. + :type delegated_subnet_arguments: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupPropertiesDelegatedSubnetArguments + :param source_subscription_id: The source subscription id to restore from. + It's required when 'createMode' is 'PointInTimeRestore' + :type source_subscription_id: str + :param source_resource_group_name: The source resource group name to + restore from. It's required when 'createMode' is 'PointInTimeRestore' + :type source_resource_group_name: str + :param source_server_group_name: The source server group name to restore + from. It's required when 'createMode' is 'PointInTimeRestore' + :type source_server_group_name: str + :param source_location: The source server group location to restore from. + It's required when 'createMode' is 'PointInTimeRestore' + :type source_location: str + :param point_in_time_utc: Restore point creation time (ISO8601 format), + specifying the time to restore from. It's required when 'createMode' is + 'PointInTimeRestore' + :type point_in_time_utc: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'earliest_restore_time': {'readonly': True}, + 'resource_provider_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'backup_retention_days': {'key': 'properties.backupRetentionDays', 'type': 'int'}, + 'postgresql_version': {'key': 'properties.postgresqlVersion', 'type': 'str'}, + 'citus_version': {'key': 'properties.citusVersion', 'type': 'str'}, + 'enable_mx': {'key': 'properties.enableMx', 'type': 'bool'}, + 'enable_zfs': {'key': 'properties.enableZfs', 'type': 'bool'}, + 'enable_shards_on_coordinator': {'key': 'properties.enableShardsOnCoordinator', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'earliest_restore_time': {'key': 'properties.earliestRestoreTime', 'type': 'iso-8601'}, + 'resource_provider_type': {'key': 'properties.resourceProviderType', 'type': 'str'}, + 'server_role_groups': {'key': 'properties.serverRoleGroups', 'type': '[ServerRoleGroup]'}, + 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, + 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, + 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, + 'delegated_subnet_arguments': {'key': 'properties.delegatedSubnetArguments', 'type': 'ServerGroupPropertiesDelegatedSubnetArguments'}, + 'source_subscription_id': {'key': 'properties.sourceSubscriptionId', 'type': 'str'}, + 'source_resource_group_name': {'key': 'properties.sourceResourceGroupName', 'type': 'str'}, + 'source_server_group_name': {'key': 'properties.sourceServerGroupName', 'type': 'str'}, + 'source_location': {'key': 'properties.sourceLocation', 'type': 'str'}, + 'point_in_time_utc': {'key': 'properties.pointInTimeUTC', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ServerGroup, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.create_mode = kwargs.get('create_mode', None) + self.administrator_login = kwargs.get('administrator_login', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.backup_retention_days = kwargs.get('backup_retention_days', None) + self.postgresql_version = kwargs.get('postgresql_version', None) + self.citus_version = kwargs.get('citus_version', None) + self.enable_mx = kwargs.get('enable_mx', None) + self.enable_zfs = kwargs.get('enable_zfs', None) + self.enable_shards_on_coordinator = kwargs.get('enable_shards_on_coordinator', None) + self.state = kwargs.get('state', None) + self.earliest_restore_time = None + self.resource_provider_type = None + self.server_role_groups = kwargs.get('server_role_groups', None) + self.maintenance_window = kwargs.get('maintenance_window', None) + self.availability_zone = kwargs.get('availability_zone', None) + self.standby_availability_zone = kwargs.get('standby_availability_zone', None) + self.delegated_subnet_arguments = kwargs.get('delegated_subnet_arguments', None) + self.source_subscription_id = kwargs.get('source_subscription_id', None) + self.source_resource_group_name = kwargs.get('source_resource_group_name', None) + self.source_server_group_name = kwargs.get('source_server_group_name', None) + self.source_location = kwargs.get('source_location', None) + self.point_in_time_utc = kwargs.get('point_in_time_utc', None) + + +class ServerGroupConfiguration(ProxyResource): + """Represents the configuration list of server role groups in a server group. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :ivar description: Description of the configuration. + :vartype description: str + :ivar data_type: Data type of the configuration. Possible values include: + 'Boolean', 'Numeric', 'Integer', 'Enumeration' + :vartype data_type: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ConfigurationDataType + :ivar allowed_values: Allowed values of the configuration. + :vartype allowed_values: str + :param server_role_group_configurations: Required. The list of server role + group configuration values. + :type server_role_group_configurations: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerRoleGroupConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'data_type': {'readonly': True}, + 'allowed_values': {'readonly': True}, + 'server_role_group_configurations': {'required': True, 'unique': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_type': {'key': 'properties.dataType', 'type': 'str'}, + 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, + 'server_role_group_configurations': {'key': 'properties.serverRoleGroupConfigurations', 'type': '[ServerRoleGroupConfiguration]'}, + } + + def __init__(self, **kwargs): + super(ServerGroupConfiguration, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.description = None + self.data_type = None + self.allowed_values = None + self.server_role_group_configurations = kwargs.get('server_role_group_configurations', None) + + +class ServerGroupForUpdate(Model): + """Represents a server group for update. + + :param location: The location the resource resides in. + :type location: str + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + :param backup_retention_days: The backup retention days for server group. + :type backup_retention_days: int + :param postgresql_version: The PostgreSQL version of server group. + Possible values include: '11', '12' + :type postgresql_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.PostgreSQLVersion + :param citus_version: The Citus version of server group. Possible values + include: '8.3', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5' + :type citus_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CitusVersion + :param enable_shards_on_coordinator: If shards on coordinator is enabled + or not for the server group. + :type enable_shards_on_coordinator: bool + :param server_role_groups: The list of server role groups. + :type server_role_groups: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerRoleGroup] + :param maintenance_window: Maintenance window of a server group. + :type maintenance_window: + ~azure.mgmt.rdbms.postgresqlhsc.models.MaintenanceWindow + :param availability_zone: Availability Zone information of the server + group. + :type availability_zone: str + :param standby_availability_zone: Standby Availability Zone information of + the server group. + :type standby_availability_zone: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'backup_retention_days': {'key': 'properties.backupRetentionDays', 'type': 'int'}, + 'postgresql_version': {'key': 'properties.postgresqlVersion', 'type': 'str'}, + 'citus_version': {'key': 'properties.citusVersion', 'type': 'str'}, + 'enable_shards_on_coordinator': {'key': 'properties.enableShardsOnCoordinator', 'type': 'bool'}, + 'server_role_groups': {'key': 'properties.serverRoleGroups', 'type': '[ServerRoleGroup]'}, + 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, + 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, + 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ServerGroupForUpdate, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.backup_retention_days = kwargs.get('backup_retention_days', None) + self.postgresql_version = kwargs.get('postgresql_version', None) + self.citus_version = kwargs.get('citus_version', None) + self.enable_shards_on_coordinator = kwargs.get('enable_shards_on_coordinator', None) + self.server_role_groups = kwargs.get('server_role_groups', None) + self.maintenance_window = kwargs.get('maintenance_window', None) + self.availability_zone = kwargs.get('availability_zone', None) + self.standby_availability_zone = kwargs.get('standby_availability_zone', None) + self.tags = kwargs.get('tags', None) + + +class ServerGroupPropertiesDelegatedSubnetArguments(Model): + """The delegated subnet arguments for a server group. + + :param subnet_arm_resource_id: delegated subnet arm resource id. + :type subnet_arm_resource_id: str + """ + + _attribute_map = { + 'subnet_arm_resource_id': {'key': 'subnetArmResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerGroupPropertiesDelegatedSubnetArguments, self).__init__(**kwargs) + self.subnet_arm_resource_id = kwargs.get('subnet_arm_resource_id', None) + + +class ServerGroupServer(ProxyResource): + """Represents a server in a server group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param server_edition: The edition of a server (default: GeneralPurpose). + Possible values include: 'GeneralPurpose', 'MemoryOptimized' + :type server_edition: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerEdition + :param storage_quota_in_mb: The storage of a server in MB (max: 2097152 = + 2TiB). + :type storage_quota_in_mb: long + :param v_cores: The vCores count of a server (max: 64). + :type v_cores: long + :param enable_ha: If high availability is enabled or not for the server. + :type enable_ha: bool + :ivar enable_public_ip: If public IP is requested or not for a server. + :vartype enable_public_ip: bool + :param fully_qualified_domain_name: The fully qualified domain name of a + server. + :type fully_qualified_domain_name: str + :param role: The role of server in the server group. Possible values + include: 'Coordinator', 'Worker' + :type role: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerRole + :param state: A state of a server that is visible to user. Possible values + include: 'Ready', 'Dropping', 'Disabled', 'Starting', 'Stopping', + 'Stopped', 'Updating', 'Provisioning' + :type state: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerState + :param ha_state: A state of a server group that is visible to user for HA + feature. Possible values include: 'NotEnabled', 'CreatingStandby', + 'ReplicatingData', 'FailingOver', 'Healthy', 'RemovingStandby', 'NotSync' + :type ha_state: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerHaState + :param administrator_login: The administrator's login name of a servers in + server group. + :type administrator_login: str + :param postgresql_version: The PostgreSQL version of server. Possible + values include: '11', '12' + :type postgresql_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.PostgreSQLVersion + :param citus_version: The Citus version of server. Possible values + include: '8.3', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5' + :type citus_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CitusVersion + :param availability_zone: Availability Zone information of the server + group. + :type availability_zone: str + :param standby_availability_zone: Standby Availability Zone information of + the server group. + :type standby_availability_zone: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'enable_public_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'server_edition': {'key': 'properties.serverEdition', 'type': 'str'}, + 'storage_quota_in_mb': {'key': 'properties.storageQuotaInMb', 'type': 'long'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'long'}, + 'enable_ha': {'key': 'properties.enableHa', 'type': 'bool'}, + 'enable_public_ip': {'key': 'properties.enablePublicIp', 'type': 'bool'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'ha_state': {'key': 'properties.haState', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'postgresql_version': {'key': 'properties.postgresqlVersion', 'type': 'str'}, + 'citus_version': {'key': 'properties.citusVersion', 'type': 'str'}, + 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, + 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerGroupServer, self).__init__(**kwargs) + self.system_data = kwargs.get('system_data', None) + self.server_edition = kwargs.get('server_edition', None) + self.storage_quota_in_mb = kwargs.get('storage_quota_in_mb', None) + self.v_cores = kwargs.get('v_cores', None) + self.enable_ha = kwargs.get('enable_ha', None) + self.enable_public_ip = None + self.fully_qualified_domain_name = kwargs.get('fully_qualified_domain_name', None) + self.role = kwargs.get('role', None) + self.state = kwargs.get('state', None) + self.ha_state = kwargs.get('ha_state', None) + self.administrator_login = kwargs.get('administrator_login', None) + self.postgresql_version = kwargs.get('postgresql_version', None) + self.citus_version = kwargs.get('citus_version', None) + self.availability_zone = kwargs.get('availability_zone', None) + self.standby_availability_zone = kwargs.get('standby_availability_zone', None) + + +class ServerNameItem(Model): + """The name object for a server. + + :param name: The name of a server. + :type name: str + :param fully_qualified_domain_name: The fully qualified domain name of a + server. + :type fully_qualified_domain_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'fully_qualified_domain_name': {'key': 'fullyQualifiedDomainName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerNameItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.fully_qualified_domain_name = kwargs.get('fully_qualified_domain_name', None) + + +class ServerProperties(Model): + """The properties of a server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param server_edition: The edition of a server (default: GeneralPurpose). + Possible values include: 'GeneralPurpose', 'MemoryOptimized' + :type server_edition: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerEdition + :param storage_quota_in_mb: The storage of a server in MB (max: 2097152 = + 2TiB). + :type storage_quota_in_mb: long + :param v_cores: The vCores count of a server (max: 64). + :type v_cores: long + :param enable_ha: If high availability is enabled or not for the server. + :type enable_ha: bool + :ivar enable_public_ip: If public IP is requested or not for a server. + :vartype enable_public_ip: bool + """ + + _validation = { + 'enable_public_ip': {'readonly': True}, + } + + _attribute_map = { + 'server_edition': {'key': 'serverEdition', 'type': 'str'}, + 'storage_quota_in_mb': {'key': 'storageQuotaInMb', 'type': 'long'}, + 'v_cores': {'key': 'vCores', 'type': 'long'}, + 'enable_ha': {'key': 'enableHa', 'type': 'bool'}, + 'enable_public_ip': {'key': 'enablePublicIp', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServerProperties, self).__init__(**kwargs) + self.server_edition = kwargs.get('server_edition', None) + self.storage_quota_in_mb = kwargs.get('storage_quota_in_mb', None) + self.v_cores = kwargs.get('v_cores', None) + self.enable_ha = kwargs.get('enable_ha', None) + self.enable_public_ip = None + + +class ServerRoleGroup(ServerProperties): + """Represents a server role group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param server_edition: The edition of a server (default: GeneralPurpose). + Possible values include: 'GeneralPurpose', 'MemoryOptimized' + :type server_edition: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerEdition + :param storage_quota_in_mb: The storage of a server in MB (max: 2097152 = + 2TiB). + :type storage_quota_in_mb: long + :param v_cores: The vCores count of a server (max: 64). + :type v_cores: long + :param enable_ha: If high availability is enabled or not for the server. + :type enable_ha: bool + :ivar enable_public_ip: If public IP is requested or not for a server. + :vartype enable_public_ip: bool + :param name: The name of the server role group. + :type name: str + :param role: The role of servers in the server role group. Possible values + include: 'Coordinator', 'Worker' + :type role: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerRole + :param server_count: The number of servers in the server role group. + :type server_count: int + :ivar server_names: The list of server names in the server role group. + :vartype server_names: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerNameItem] + """ + + _validation = { + 'enable_public_ip': {'readonly': True}, + 'server_names': {'readonly': True, 'unique': True}, + } + + _attribute_map = { + 'server_edition': {'key': 'serverEdition', 'type': 'str'}, + 'storage_quota_in_mb': {'key': 'storageQuotaInMb', 'type': 'long'}, + 'v_cores': {'key': 'vCores', 'type': 'long'}, + 'enable_ha': {'key': 'enableHa', 'type': 'bool'}, + 'enable_public_ip': {'key': 'enablePublicIp', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + 'server_count': {'key': 'serverCount', 'type': 'int'}, + 'server_names': {'key': 'serverNames', 'type': '[ServerNameItem]'}, + } + + def __init__(self, **kwargs): + super(ServerRoleGroup, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.role = kwargs.get('role', None) + self.server_count = kwargs.get('server_count', None) + self.server_names = None + + +class ServerRoleGroupConfiguration(Model): + """Represents server role group configuration value. + + 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. + + :param role: Required. The role of servers in the server role group. + Possible values include: 'Coordinator', 'Worker' + :type role: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerRole + :param value: Required. Value of the configuration. + :type value: str + :ivar default_value: Default value of the configuration. + :vartype default_value: str + :ivar source: Source of the configuration. + :vartype source: str + """ + + _validation = { + 'role': {'required': True}, + 'value': {'required': True}, + 'default_value': {'readonly': True}, + 'source': {'readonly': True}, + } + + _attribute_map = { + 'role': {'key': 'role', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerRoleGroupConfiguration, self).__init__(**kwargs) + self.role = kwargs.get('role', None) + self.value = kwargs.get('value', None) + self.default_value = None + self.source = 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.postgresqlhsc.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.postgresqlhsc.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) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_models_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_models_py3.py new file mode 100644 index 000000000000..2b30c753e9f7 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_models_py3.py @@ -0,0 +1,1186 @@ +# 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.serialization import Model +from msrest.exceptions import HttpOperationError + + +class Resource(Model): + """Resource. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """An error response from the Batch service. + + :param error: The error. + :type error: ~azure.mgmt.rdbms.postgresqlhsc.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Batch service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.rdbms.postgresqlhsc.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class FirewallRule(ProxyResource): + """Represents a server group firewall rule. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param start_ip_address: Required. The start IP address of the server + group firewall rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: Required. The end IP address of the server group + firewall rule. Must be IPv4 format. + :type end_ip_address: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + 'end_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, + } + + def __init__(self, *, start_ip_address: str, end_ip_address: str, system_data=None, **kwargs) -> None: + super(FirewallRule, self).__init__(**kwargs) + self.system_data = system_data + self.start_ip_address = start_ip_address + self.end_ip_address = end_ip_address + + +class MaintenanceWindow(Model): + """Maintenance window of a server group. + + :param custom_window: indicates whether custom window is enabled or + disabled + :type custom_window: str + :param start_hour: start hour for maintenance window + :type start_hour: int + :param start_minute: start minute for maintenance window + :type start_minute: int + :param day_of_week: day of week for maintenance window + :type day_of_week: int + """ + + _attribute_map = { + 'custom_window': {'key': 'customWindow', 'type': 'str'}, + 'start_hour': {'key': 'startHour', 'type': 'int'}, + 'start_minute': {'key': 'startMinute', 'type': 'int'}, + 'day_of_week': {'key': 'dayOfWeek', 'type': 'int'}, + } + + def __init__(self, *, custom_window: str=None, start_hour: int=None, start_minute: int=None, day_of_week: int=None, **kwargs) -> None: + super(MaintenanceWindow, self).__init__(**kwargs) + self.custom_window = custom_window + self.start_hour = start_hour + self.start_minute = start_minute + self.day_of_week = day_of_week + + +class NameAvailability(Model): + """Represents a resource name availability. + + :param message: Error Message. + :type message: str + :param name_available: Indicates whether the resource name is available. + :type name_available: bool + :param name: name of the PostgreSQL server. + :type name: str + :param type: type of the server + :type type: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, name_available: bool=None, name: str=None, type: str=None, **kwargs) -> None: + super(NameAvailability, self).__init__(**kwargs) + self.message = message + self.name_available = name_available + self.name = name + self.type = type + + +class NameAvailabilityRequest(Model): + """Request from client to check resource name availability. + + 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. + + :param name: Required. Resource name to verify. + :type name: str + :ivar type: Required. Resource type used for verification. Default value: + "Microsoft.DBforPostgreSQL/serverGroupsv2" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.DBforPostgreSQL/serverGroupsv2" + + def __init__(self, *, name: str, **kwargs) -> None: + super(NameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + + +class Operation(Model): + """REST API operation definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: The localized display information for this particular + operation or action. + :vartype display: ~azure.mgmt.rdbms.postgresqlhsc.models.OperationDisplay + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :ivar origin: The intended executor of the operation. Possible values + include: 'NotSpecified', 'user', 'system' + :vartype origin: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.OperationOrigin + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, object] + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'origin': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__(self, *, is_data_action: bool=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + self.is_data_action = is_data_action + self.origin = None + self.properties = None + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Operation resource provider name. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Localized friendly name for the operation. + :vartype operation: str + :ivar description: Operation description. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class Role(ProxyResource): + """Represents a server group role. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param password: Required. The password of the server group role. + :type password: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'password': {'key': 'properties.password', 'type': 'str'}, + } + + def __init__(self, *, password: str, system_data=None, **kwargs) -> None: + super(Role, self).__init__(**kwargs) + self.system_data = system_data + self.password = password + + +class ServerConfiguration(ProxyResource): + """Represents a configuration. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param value: Required. Value of the configuration. + :type value: str + :ivar source: Source of the configuration. + :vartype source: str + :ivar description: Description of the configuration. + :vartype description: str + :ivar default_value: Default value of the configuration. + :vartype default_value: str + :ivar data_type: Data type of the configuration. Possible values include: + 'Boolean', 'Numeric', 'Integer', 'Enumeration' + :vartype data_type: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ConfigurationDataType + :ivar allowed_values: Allowed values of the configuration. + :vartype allowed_values: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'value': {'required': True}, + 'source': {'readonly': True}, + 'description': {'readonly': True}, + 'default_value': {'readonly': True}, + 'data_type': {'readonly': True}, + 'allowed_values': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, + 'data_type': {'key': 'properties.dataType', 'type': 'str'}, + 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, + } + + def __init__(self, *, value: str, system_data=None, **kwargs) -> None: + super(ServerConfiguration, self).__init__(**kwargs) + self.system_data = system_data + self.value = value + self.source = None + self.description = None + self.default_value = None + self.data_type = None + self.allowed_values = None + + +class TrackedResource(Resource): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class ServerGroup(TrackedResource): + """Represents a server group for create. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param create_mode: The mode to create a new server group. Possible values + include: 'Default', 'PointInTimeRestore' + :type create_mode: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CreateMode + :param administrator_login: The administrator's login name of servers in + server group. Can only be specified when the server is being created (and + is required for creation). + :type administrator_login: str + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + :param backup_retention_days: The backup retention days for server group. + :type backup_retention_days: int + :param postgresql_version: The PostgreSQL version of server group. + Possible values include: '11', '12' + :type postgresql_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.PostgreSQLVersion + :param citus_version: The Citus version of server group. Possible values + include: '8.3', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5' + :type citus_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CitusVersion + :param enable_mx: If Citus MX is enabled or not for the server group. + :type enable_mx: bool + :param enable_zfs: If ZFS compression is enabled or not for the server + group. + :type enable_zfs: bool + :param enable_shards_on_coordinator: If shards on coordinator is enabled + or not for the server group. + :type enable_shards_on_coordinator: bool + :param state: A state of a server group that is visible to user. Possible + values include: 'Ready', 'Dropping', 'Disabled', 'Starting', 'Stopping', + 'Stopped', 'Updating', 'Provisioning' + :type state: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerState + :ivar earliest_restore_time: The earliest restore point time (ISO8601 + format) for server group. + :vartype earliest_restore_time: datetime + :ivar resource_provider_type: The resource provider type of server group. + Possible values include: 'Meru', 'Marlin' + :vartype resource_provider_type: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ResourceProviderType + :param server_role_groups: The list of server role groups. + :type server_role_groups: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerRoleGroup] + :param maintenance_window: Maintenance window of a server group. + :type maintenance_window: + ~azure.mgmt.rdbms.postgresqlhsc.models.MaintenanceWindow + :param availability_zone: Availability Zone information of the server + group. + :type availability_zone: str + :param standby_availability_zone: Standby Availability Zone information of + the server group. + :type standby_availability_zone: str + :param delegated_subnet_arguments: The delegated subnet arguments for a + server group. + :type delegated_subnet_arguments: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupPropertiesDelegatedSubnetArguments + :param source_subscription_id: The source subscription id to restore from. + It's required when 'createMode' is 'PointInTimeRestore' + :type source_subscription_id: str + :param source_resource_group_name: The source resource group name to + restore from. It's required when 'createMode' is 'PointInTimeRestore' + :type source_resource_group_name: str + :param source_server_group_name: The source server group name to restore + from. It's required when 'createMode' is 'PointInTimeRestore' + :type source_server_group_name: str + :param source_location: The source server group location to restore from. + It's required when 'createMode' is 'PointInTimeRestore' + :type source_location: str + :param point_in_time_utc: Restore point creation time (ISO8601 format), + specifying the time to restore from. It's required when 'createMode' is + 'PointInTimeRestore' + :type point_in_time_utc: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'earliest_restore_time': {'readonly': True}, + 'resource_provider_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'backup_retention_days': {'key': 'properties.backupRetentionDays', 'type': 'int'}, + 'postgresql_version': {'key': 'properties.postgresqlVersion', 'type': 'str'}, + 'citus_version': {'key': 'properties.citusVersion', 'type': 'str'}, + 'enable_mx': {'key': 'properties.enableMx', 'type': 'bool'}, + 'enable_zfs': {'key': 'properties.enableZfs', 'type': 'bool'}, + 'enable_shards_on_coordinator': {'key': 'properties.enableShardsOnCoordinator', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'earliest_restore_time': {'key': 'properties.earliestRestoreTime', 'type': 'iso-8601'}, + 'resource_provider_type': {'key': 'properties.resourceProviderType', 'type': 'str'}, + 'server_role_groups': {'key': 'properties.serverRoleGroups', 'type': '[ServerRoleGroup]'}, + 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, + 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, + 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, + 'delegated_subnet_arguments': {'key': 'properties.delegatedSubnetArguments', 'type': 'ServerGroupPropertiesDelegatedSubnetArguments'}, + 'source_subscription_id': {'key': 'properties.sourceSubscriptionId', 'type': 'str'}, + 'source_resource_group_name': {'key': 'properties.sourceResourceGroupName', 'type': 'str'}, + 'source_server_group_name': {'key': 'properties.sourceServerGroupName', 'type': 'str'}, + 'source_location': {'key': 'properties.sourceLocation', 'type': 'str'}, + 'point_in_time_utc': {'key': 'properties.pointInTimeUTC', 'type': 'iso-8601'}, + } + + def __init__(self, *, location: str, tags=None, system_data=None, create_mode=None, administrator_login: str=None, administrator_login_password: str=None, backup_retention_days: int=None, postgresql_version=None, citus_version=None, enable_mx: bool=None, enable_zfs: bool=None, enable_shards_on_coordinator: bool=None, state=None, server_role_groups=None, maintenance_window=None, availability_zone: str=None, standby_availability_zone: str=None, delegated_subnet_arguments=None, source_subscription_id: str=None, source_resource_group_name: str=None, source_server_group_name: str=None, source_location: str=None, point_in_time_utc=None, **kwargs) -> None: + super(ServerGroup, self).__init__(tags=tags, location=location, **kwargs) + self.system_data = system_data + self.create_mode = create_mode + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.backup_retention_days = backup_retention_days + self.postgresql_version = postgresql_version + self.citus_version = citus_version + self.enable_mx = enable_mx + self.enable_zfs = enable_zfs + self.enable_shards_on_coordinator = enable_shards_on_coordinator + self.state = state + self.earliest_restore_time = None + self.resource_provider_type = None + self.server_role_groups = server_role_groups + self.maintenance_window = maintenance_window + self.availability_zone = availability_zone + self.standby_availability_zone = standby_availability_zone + self.delegated_subnet_arguments = delegated_subnet_arguments + self.source_subscription_id = source_subscription_id + self.source_resource_group_name = source_resource_group_name + self.source_server_group_name = source_server_group_name + self.source_location = source_location + self.point_in_time_utc = point_in_time_utc + + +class ServerGroupConfiguration(ProxyResource): + """Represents the configuration list of server role groups in a server group. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :ivar description: Description of the configuration. + :vartype description: str + :ivar data_type: Data type of the configuration. Possible values include: + 'Boolean', 'Numeric', 'Integer', 'Enumeration' + :vartype data_type: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ConfigurationDataType + :ivar allowed_values: Allowed values of the configuration. + :vartype allowed_values: str + :param server_role_group_configurations: Required. The list of server role + group configuration values. + :type server_role_group_configurations: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerRoleGroupConfiguration] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'data_type': {'readonly': True}, + 'allowed_values': {'readonly': True}, + 'server_role_group_configurations': {'required': True, 'unique': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'data_type': {'key': 'properties.dataType', 'type': 'str'}, + 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, + 'server_role_group_configurations': {'key': 'properties.serverRoleGroupConfigurations', 'type': '[ServerRoleGroupConfiguration]'}, + } + + def __init__(self, *, server_role_group_configurations, system_data=None, **kwargs) -> None: + super(ServerGroupConfiguration, self).__init__(**kwargs) + self.system_data = system_data + self.description = None + self.data_type = None + self.allowed_values = None + self.server_role_group_configurations = server_role_group_configurations + + +class ServerGroupForUpdate(Model): + """Represents a server group for update. + + :param location: The location the resource resides in. + :type location: str + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + :param backup_retention_days: The backup retention days for server group. + :type backup_retention_days: int + :param postgresql_version: The PostgreSQL version of server group. + Possible values include: '11', '12' + :type postgresql_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.PostgreSQLVersion + :param citus_version: The Citus version of server group. Possible values + include: '8.3', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5' + :type citus_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CitusVersion + :param enable_shards_on_coordinator: If shards on coordinator is enabled + or not for the server group. + :type enable_shards_on_coordinator: bool + :param server_role_groups: The list of server role groups. + :type server_role_groups: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerRoleGroup] + :param maintenance_window: Maintenance window of a server group. + :type maintenance_window: + ~azure.mgmt.rdbms.postgresqlhsc.models.MaintenanceWindow + :param availability_zone: Availability Zone information of the server + group. + :type availability_zone: str + :param standby_availability_zone: Standby Availability Zone information of + the server group. + :type standby_availability_zone: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'backup_retention_days': {'key': 'properties.backupRetentionDays', 'type': 'int'}, + 'postgresql_version': {'key': 'properties.postgresqlVersion', 'type': 'str'}, + 'citus_version': {'key': 'properties.citusVersion', 'type': 'str'}, + 'enable_shards_on_coordinator': {'key': 'properties.enableShardsOnCoordinator', 'type': 'bool'}, + 'server_role_groups': {'key': 'properties.serverRoleGroups', 'type': '[ServerRoleGroup]'}, + 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, + 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, + 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, administrator_login_password: str=None, backup_retention_days: int=None, postgresql_version=None, citus_version=None, enable_shards_on_coordinator: bool=None, server_role_groups=None, maintenance_window=None, availability_zone: str=None, standby_availability_zone: str=None, tags=None, **kwargs) -> None: + super(ServerGroupForUpdate, self).__init__(**kwargs) + self.location = location + self.administrator_login_password = administrator_login_password + self.backup_retention_days = backup_retention_days + self.postgresql_version = postgresql_version + self.citus_version = citus_version + self.enable_shards_on_coordinator = enable_shards_on_coordinator + self.server_role_groups = server_role_groups + self.maintenance_window = maintenance_window + self.availability_zone = availability_zone + self.standby_availability_zone = standby_availability_zone + self.tags = tags + + +class ServerGroupPropertiesDelegatedSubnetArguments(Model): + """The delegated subnet arguments for a server group. + + :param subnet_arm_resource_id: delegated subnet arm resource id. + :type subnet_arm_resource_id: str + """ + + _attribute_map = { + 'subnet_arm_resource_id': {'key': 'subnetArmResourceId', 'type': 'str'}, + } + + def __init__(self, *, subnet_arm_resource_id: str=None, **kwargs) -> None: + super(ServerGroupPropertiesDelegatedSubnetArguments, self).__init__(**kwargs) + self.subnet_arm_resource_id = subnet_arm_resource_id + + +class ServerGroupServer(ProxyResource): + """Represents a server in a server group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param server_edition: The edition of a server (default: GeneralPurpose). + Possible values include: 'GeneralPurpose', 'MemoryOptimized' + :type server_edition: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerEdition + :param storage_quota_in_mb: The storage of a server in MB (max: 2097152 = + 2TiB). + :type storage_quota_in_mb: long + :param v_cores: The vCores count of a server (max: 64). + :type v_cores: long + :param enable_ha: If high availability is enabled or not for the server. + :type enable_ha: bool + :ivar enable_public_ip: If public IP is requested or not for a server. + :vartype enable_public_ip: bool + :param fully_qualified_domain_name: The fully qualified domain name of a + server. + :type fully_qualified_domain_name: str + :param role: The role of server in the server group. Possible values + include: 'Coordinator', 'Worker' + :type role: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerRole + :param state: A state of a server that is visible to user. Possible values + include: 'Ready', 'Dropping', 'Disabled', 'Starting', 'Stopping', + 'Stopped', 'Updating', 'Provisioning' + :type state: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerState + :param ha_state: A state of a server group that is visible to user for HA + feature. Possible values include: 'NotEnabled', 'CreatingStandby', + 'ReplicatingData', 'FailingOver', 'Healthy', 'RemovingStandby', 'NotSync' + :type ha_state: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerHaState + :param administrator_login: The administrator's login name of a servers in + server group. + :type administrator_login: str + :param postgresql_version: The PostgreSQL version of server. Possible + values include: '11', '12' + :type postgresql_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.PostgreSQLVersion + :param citus_version: The Citus version of server. Possible values + include: '8.3', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5' + :type citus_version: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.CitusVersion + :param availability_zone: Availability Zone information of the server + group. + :type availability_zone: str + :param standby_availability_zone: Standby Availability Zone information of + the server group. + :type standby_availability_zone: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'enable_public_ip': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'server_edition': {'key': 'properties.serverEdition', 'type': 'str'}, + 'storage_quota_in_mb': {'key': 'properties.storageQuotaInMb', 'type': 'long'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'long'}, + 'enable_ha': {'key': 'properties.enableHa', 'type': 'bool'}, + 'enable_public_ip': {'key': 'properties.enablePublicIp', 'type': 'bool'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'ha_state': {'key': 'properties.haState', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'postgresql_version': {'key': 'properties.postgresqlVersion', 'type': 'str'}, + 'citus_version': {'key': 'properties.citusVersion', 'type': 'str'}, + 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, + 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, + } + + def __init__(self, *, system_data=None, server_edition=None, storage_quota_in_mb: int=None, v_cores: int=None, enable_ha: bool=None, fully_qualified_domain_name: str=None, role=None, state=None, ha_state=None, administrator_login: str=None, postgresql_version=None, citus_version=None, availability_zone: str=None, standby_availability_zone: str=None, **kwargs) -> None: + super(ServerGroupServer, self).__init__(**kwargs) + self.system_data = system_data + self.server_edition = server_edition + self.storage_quota_in_mb = storage_quota_in_mb + self.v_cores = v_cores + self.enable_ha = enable_ha + self.enable_public_ip = None + self.fully_qualified_domain_name = fully_qualified_domain_name + self.role = role + self.state = state + self.ha_state = ha_state + self.administrator_login = administrator_login + self.postgresql_version = postgresql_version + self.citus_version = citus_version + self.availability_zone = availability_zone + self.standby_availability_zone = standby_availability_zone + + +class ServerNameItem(Model): + """The name object for a server. + + :param name: The name of a server. + :type name: str + :param fully_qualified_domain_name: The fully qualified domain name of a + server. + :type fully_qualified_domain_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'fully_qualified_domain_name': {'key': 'fullyQualifiedDomainName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, fully_qualified_domain_name: str=None, **kwargs) -> None: + super(ServerNameItem, self).__init__(**kwargs) + self.name = name + self.fully_qualified_domain_name = fully_qualified_domain_name + + +class ServerProperties(Model): + """The properties of a server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param server_edition: The edition of a server (default: GeneralPurpose). + Possible values include: 'GeneralPurpose', 'MemoryOptimized' + :type server_edition: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerEdition + :param storage_quota_in_mb: The storage of a server in MB (max: 2097152 = + 2TiB). + :type storage_quota_in_mb: long + :param v_cores: The vCores count of a server (max: 64). + :type v_cores: long + :param enable_ha: If high availability is enabled or not for the server. + :type enable_ha: bool + :ivar enable_public_ip: If public IP is requested or not for a server. + :vartype enable_public_ip: bool + """ + + _validation = { + 'enable_public_ip': {'readonly': True}, + } + + _attribute_map = { + 'server_edition': {'key': 'serverEdition', 'type': 'str'}, + 'storage_quota_in_mb': {'key': 'storageQuotaInMb', 'type': 'long'}, + 'v_cores': {'key': 'vCores', 'type': 'long'}, + 'enable_ha': {'key': 'enableHa', 'type': 'bool'}, + 'enable_public_ip': {'key': 'enablePublicIp', 'type': 'bool'}, + } + + def __init__(self, *, server_edition=None, storage_quota_in_mb: int=None, v_cores: int=None, enable_ha: bool=None, **kwargs) -> None: + super(ServerProperties, self).__init__(**kwargs) + self.server_edition = server_edition + self.storage_quota_in_mb = storage_quota_in_mb + self.v_cores = v_cores + self.enable_ha = enable_ha + self.enable_public_ip = None + + +class ServerRoleGroup(ServerProperties): + """Represents a server role group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param server_edition: The edition of a server (default: GeneralPurpose). + Possible values include: 'GeneralPurpose', 'MemoryOptimized' + :type server_edition: str or + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerEdition + :param storage_quota_in_mb: The storage of a server in MB (max: 2097152 = + 2TiB). + :type storage_quota_in_mb: long + :param v_cores: The vCores count of a server (max: 64). + :type v_cores: long + :param enable_ha: If high availability is enabled or not for the server. + :type enable_ha: bool + :ivar enable_public_ip: If public IP is requested or not for a server. + :vartype enable_public_ip: bool + :param name: The name of the server role group. + :type name: str + :param role: The role of servers in the server role group. Possible values + include: 'Coordinator', 'Worker' + :type role: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerRole + :param server_count: The number of servers in the server role group. + :type server_count: int + :ivar server_names: The list of server names in the server role group. + :vartype server_names: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerNameItem] + """ + + _validation = { + 'enable_public_ip': {'readonly': True}, + 'server_names': {'readonly': True, 'unique': True}, + } + + _attribute_map = { + 'server_edition': {'key': 'serverEdition', 'type': 'str'}, + 'storage_quota_in_mb': {'key': 'storageQuotaInMb', 'type': 'long'}, + 'v_cores': {'key': 'vCores', 'type': 'long'}, + 'enable_ha': {'key': 'enableHa', 'type': 'bool'}, + 'enable_public_ip': {'key': 'enablePublicIp', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'role': {'key': 'role', 'type': 'str'}, + 'server_count': {'key': 'serverCount', 'type': 'int'}, + 'server_names': {'key': 'serverNames', 'type': '[ServerNameItem]'}, + } + + def __init__(self, *, server_edition=None, storage_quota_in_mb: int=None, v_cores: int=None, enable_ha: bool=None, name: str=None, role=None, server_count: int=None, **kwargs) -> None: + super(ServerRoleGroup, self).__init__(server_edition=server_edition, storage_quota_in_mb=storage_quota_in_mb, v_cores=v_cores, enable_ha=enable_ha, **kwargs) + self.name = name + self.role = role + self.server_count = server_count + self.server_names = None + + +class ServerRoleGroupConfiguration(Model): + """Represents server role group configuration value. + + 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. + + :param role: Required. The role of servers in the server role group. + Possible values include: 'Coordinator', 'Worker' + :type role: str or ~azure.mgmt.rdbms.postgresqlhsc.models.ServerRole + :param value: Required. Value of the configuration. + :type value: str + :ivar default_value: Default value of the configuration. + :vartype default_value: str + :ivar source: Source of the configuration. + :vartype source: str + """ + + _validation = { + 'role': {'required': True}, + 'value': {'required': True}, + 'default_value': {'readonly': True}, + 'source': {'readonly': True}, + } + + _attribute_map = { + 'role': {'key': 'role', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'str'}, + } + + def __init__(self, *, role, value: str, **kwargs) -> None: + super(ServerRoleGroupConfiguration, self).__init__(**kwargs) + self.role = role + self.value = value + self.default_value = None + self.source = 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.postgresqlhsc.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.postgresqlhsc.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 diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_paged_models.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_paged_models.py new file mode 100644 index 000000000000..d3cfdd38ed8b --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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 ServerGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerGroupPaged, self).__init__(*args, **kwargs) +class ServerGroupServerPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerGroupServer ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerGroupServer]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerGroupServerPaged, self).__init__(*args, **kwargs) +class ServerConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerConfigurationPaged, self).__init__(*args, **kwargs) +class ServerGroupConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerGroupConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerGroupConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerGroupConfigurationPaged, self).__init__(*args, **kwargs) +class FirewallRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`FirewallRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FirewallRule]'} + } + + def __init__(self, *args, **kwargs): + + super(FirewallRulePaged, self).__init__(*args, **kwargs) +class RolePaged(Paged): + """ + A paging container for iterating over a list of :class:`Role ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Role]'} + } + + def __init__(self, *args, **kwargs): + + super(RolePaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/__init__.py new file mode 100644 index 000000000000..b46d01b812de --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/__init__.py @@ -0,0 +1,26 @@ +# 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 ._server_groups_operations import ServerGroupsOperations +from ._servers_operations import ServersOperations +from ._configurations_operations import ConfigurationsOperations +from ._firewall_rules_operations import FirewallRulesOperations +from ._roles_operations import RolesOperations +from ._operations import Operations + +__all__ = [ + 'ServerGroupsOperations', + 'ServersOperations', + 'ConfigurationsOperations', + 'FirewallRulesOperations', + 'RolesOperations', + 'Operations', +] diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_configurations_operations.py new file mode 100644 index 000000000000..8f5eb1fc1d70 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_configurations_operations.py @@ -0,0 +1,370 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ConfigurationsOperations(object): + """ConfigurationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-10-05-privatepreview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-05-privatepreview" + + self.config = config + + def list_by_server( + self, resource_group_name, server_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the configurations of a server in server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ServerConfiguration + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerConfigurationPaged[~azure.mgmt.rdbms.postgresqlhsc.models.ServerConfiguration] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'serverName': self._serialize.url("server_name", server_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServerConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/servers/{serverName}/configurations'} + + def list_by_server_group( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + """List all the configurations of a server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ServerGroupConfiguration + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupConfigurationPaged[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupConfiguration] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_server_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServerGroupConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_server_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/configurations'} + + + def _update_initial( + self, resource_group_name, server_group_name, configuration_name, server_role_group_configurations, system_data=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ServerGroupConfiguration(system_data=system_data, server_role_group_configurations=server_role_group_configurations) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServerGroupConfiguration') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerGroupConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, server_group_name, configuration_name, server_role_group_configurations, system_data=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates configuration of server role groups in a server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param configuration_name: The name of the server group configuration. + :type configuration_name: str + :param server_role_group_configurations: The list of server role group + configuration values. + :type server_role_group_configurations: + list[~azure.mgmt.rdbms.postgresqlhsc.models.ServerRoleGroupConfiguration] + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ServerGroupConfiguration or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupConfiguration] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupConfiguration]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + configuration_name=configuration_name, + server_role_group_configurations=server_role_group_configurations, + system_data=system_data, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServerGroupConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/configurations/{configurationName}'} + + def get( + self, resource_group_name, server_group_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets information about single server group configuration. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param configuration_name: The name of the server group configuration. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ServerGroupConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupConfiguration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServerGroupConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/configurations/{configurationName}'} diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_firewall_rules_operations.py new file mode 100644 index 000000000000..a08a082ef562 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_firewall_rules_operations.py @@ -0,0 +1,372 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class FirewallRulesOperations(object): + """FirewallRulesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-10-05-privatepreview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-05-privatepreview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, server_group_name, firewall_rule_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'FirewallRule') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_group_name, firewall_rule_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new firewall rule or updates an existing firewall rule. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param firewall_rule_name: The name of the server group firewall rule. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a + firewall rule. + :type parameters: ~azure.mgmt.rdbms.postgresqlhsc.models.FirewallRule + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns FirewallRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresqlhsc.models.FirewallRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.postgresqlhsc.models.FirewallRule]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + firewall_rule_name=firewall_rule_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/firewallRules/{firewallRuleName}'} + + + def _delete_initial( + self, resource_group_name, server_group_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_group_name, firewall_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a server group firewall rule. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param firewall_rule_name: The name of the server group firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + firewall_rule_name=firewall_rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/firewallRules/{firewallRuleName}'} + + def get( + self, resource_group_name, server_group_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a server group firewall rule. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param firewall_rule_name: The name of the server group firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FirewallRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgresqlhsc.models.FirewallRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/firewallRules/{firewallRuleName}'} + + def list_by_server_group( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + """List all the firewall rules in a given server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FirewallRule + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.FirewallRulePaged[~azure.mgmt.rdbms.postgresqlhsc.models.FirewallRule] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_server_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_server_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/firewallRules'} diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_operations.py new file mode 100644 index 000000000000..706717c69048 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-10-05-privatepreview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-05-privatepreview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.OperationPaged[~azure.mgmt.rdbms.postgresqlhsc.models.Operation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.DBForPostgreSql/operations'} diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_roles_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_roles_operations.py new file mode 100644 index 000000000000..11f3be552137 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_roles_operations.py @@ -0,0 +1,311 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class RolesOperations(object): + """RolesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-10-05-privatepreview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-05-privatepreview" + + self.config = config + + + def _create_initial( + self, resource_group_name, server_group_name, role_name, password, system_data=None, custom_headers=None, raw=False, **operation_config): + parameters = models.Role(system_data=system_data, password=password) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'roleName': self._serialize.url("role_name", role_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Role') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Role', response) + if response.status_code == 201: + deserialized = self._deserialize('Role', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, server_group_name, role_name, password, system_data=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new role or updates an existing role. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param role_name: The name of the server group role name. + :type role_name: str + :param password: The password of the server group role. + :type password: str + :param system_data: The system metadata relating to this resource + :type system_data: ~azure.mgmt.rdbms.postgresqlhsc.models.SystemData + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Role or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresqlhsc.models.Role] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.postgresqlhsc.models.Role]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + role_name=role_name, + password=password, + system_data=system_data, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Role', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/roles/{roleName}'} + + + def _delete_initial( + self, resource_group_name, server_group_name, role_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'roleName': self._serialize.url("role_name", role_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_group_name, role_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a server group role. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param role_name: The name of the server group role name. + :type role_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + role_name=role_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/roles/{roleName}'} + + def list_by_server_group( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + """List all the roles in a given server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Role + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.RolePaged[~azure.mgmt.rdbms.postgresqlhsc.models.Role] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_server_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RolePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_server_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/roles'} diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_server_groups_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_server_groups_operations.py new file mode 100644 index 000000000000..b83b8f739e14 --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_server_groups_operations.py @@ -0,0 +1,830 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ServerGroupsOperations(object): + """ServerGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-10-05-privatepreview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-05-privatepreview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all the server groups in a given subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ServerGroup + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupPaged[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServerGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/serverGroupsv2'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all the server groups in a given resource group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ServerGroup + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupPaged[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServerGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2'} + + + def _create_or_update_initial( + self, resource_group_name, server_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServerGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('ServerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new server group with servers. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param parameters: The required parameters for creating or updating a + server group. + :type parameters: ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServerGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}'} + + def get( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ServerGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}'} + + + def _delete_initial( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a server group together with servers in it. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}'} + + + def _update_initial( + self, resource_group_name, server_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServerGroupForUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, server_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an existing server group. The request body can contain one to + many of the properties present in the normal server group definition. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param parameters: The parameters for updating a server group. + :type parameters: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupForUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServerGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServerGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}'} + + + def _restart_initial( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restart.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def restart( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Restarts the server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/restart'} + + + def _start_initial( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def start( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Starts the server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/start'} + + + def _stop_initial( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def stop( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stops the server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + server_group_name=server_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/stop'} + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Check the availability of name for resource. + + :param name: Resource name to verify. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgresqlhsc.models.NameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + name_availability_request = models.NameAvailabilityRequest(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(name_availability_request, 'NameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/checkNameAvailability'} diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_servers_operations.py new file mode 100644 index 000000000000..12320e5ee5eb --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/operations/_servers_operations.py @@ -0,0 +1,178 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ServersOperations(object): + """ServersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-10-05-privatepreview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-10-05-privatepreview" + + self.config = config + + def list_by_server_group( + self, resource_group_name, server_group_name, custom_headers=None, raw=False, **operation_config): + """Lists servers of a server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ServerGroupServer + :rtype: + ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupServerPaged[~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupServer] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_server_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServerGroupServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_server_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/servers'} + + def get( + self, resource_group_name, server_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a server in server group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param server_group_name: The name of the server group. + :type server_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ServerGroupServer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgresqlhsc.models.ServerGroupServer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'serverGroupName': self._serialize.url("server_group_name", server_group_name, 'str', max_length=90, min_length=1), + 'serverName': self._serialize.url("server_name", server_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServerGroupServer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/serverGroupsv2/{serverGroupName}/servers/{serverName}'} diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/version.py new file mode 100644 index 000000000000..27321e9ba04f --- /dev/null +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2020-10-05-privatepreview" +