forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 11526 in Azure/azure-rest-api-specs
Draft PR for PostgreSQLHSC (Azure#11526) * New Readme Config File * New Go Language Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New Ruby Language Readme Config File * New Swagger Spec File * New Swagger Example Spec File * initial swagger * common-types path fix * definition reference fix * Change publicIpRequested boolean with publicNetworkAccess enum * Change serverGroups to ServerGroupsv2 in path and id * Add responses to examples * Add missing location property to examples * Add missing locations to requests * Remove required name * Fix server group update * Convert some enums to boolean and renamings * Fix typo * Fix role properties problem * Add Citus to custom words * Run json prettier * Change responce for put server group * Fix role empty properties * Add state to server group * Update readmes * Add resourceProviderType to server group * Add sourceLocation to server group PITR * Change backup retention minutes to days * Fix linter errors * Add EarliestRestoreTime to server group * Fix semantic * Add Meru to custom words * Proviver name to pascal case * Add format for integers * Add 204 to delete * Add server group list endpoints * Fix listing operations * Change servers operation id * Remove haState from server role group * Add missing state to ServerState * Refactor configuration API * Add missing readOnly properties * Move ServerGroupConfig.defaultValue to ServerRoleGroupConfig * Rename serverRoleGroupConfigurationValues to serverRoleGroupConfigurations * Rename java namespace * Add systemData to all resources * Fix CheckNameAvailability warning * Run prettier * Add "fullyQualifiedDomainName" to server * Remove update from createMode * Remove createMode discriminator * Update ServerGet example * Add citusVersion to ServerGroupServer * Update descriptions for zfs and mx * Separate server group update properties * Add MMW to server group * Update sdk READMEs for namespaces * Refactor booleans with "enable..." prefix * Rename version with postgresqlVersion * Change vnetInjArgs to delegatedSubnetArguments * Add enableShardsOnCoordinator to server group * Add availability zone to server group and server group server * Add standbyAvailabilityZone to examples Co-authored-by: Enes Cakir <[email protected]>
- Loading branch information
Showing
16 changed files
with
5,039 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
48 changes: 48 additions & 0 deletions
48
sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<msrestazure.azure_active_directory>` | ||
: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 |
74 changes: 74 additions & 0 deletions
74
...dbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/_microsoft_postgre_sql_hyperscale.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<msrestazure.azure_active_directory>` | ||
: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) |
120 changes: 120 additions & 0 deletions
120
sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', | ||
] |
99 changes: 99 additions & 0 deletions
99
...mt-rdbms/azure/mgmt/rdbms/postgresqlhsc/models/_microsoft_postgre_sql_hyperscale_enums.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
Oops, something went wrong.