forked from Azure/azure-cli-extensions
-
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 13716 in Azure/azure-rest-api-specs
Merge b39acba4515d089008a4c8803db6daa18f7324e1 into 3cba7d6
- Loading branch information
SDKAuto
committed
Apr 16, 2021
1 parent
f9292b3
commit c4732fe
Showing
49 changed files
with
11,324 additions
and
0 deletions.
There are no files selected for viewing
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,8 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
0.1.0 | ||
++++++ | ||
* Initial release. |
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,148 @@ | ||
# Azure CLI postgresqlhsc Extension # | ||
This is the extension for postgresqlhsc | ||
|
||
### How to use ### | ||
Install this extension using the below CLI command | ||
``` | ||
az extension add --name postgresqlhsc | ||
``` | ||
|
||
### Included Features ### | ||
#### postgresqlhsc server-group #### | ||
##### Create ##### | ||
``` | ||
az postgresqlhsc server-group create --location "westus" --administrator-login "citus" \ | ||
--administrator-login-password "password" --availability-zone "1" --backup-retention-days 35 --citus-version "9.5" \ | ||
--subnet-arm-resource-id "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet" \ | ||
--enable-mx true --enable-zfs false --postgresql-version "12" \ | ||
--private-dns-zone-arm-resource-id "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone" \ | ||
--server-role-groups name="" enable-ha=true role="Coordinator" server-count=1 server-edition="GeneralPurpose" storage-quota-in-mb=524288 v-cores=4 \ | ||
--server-role-groups name="" enable-ha=false role="Worker" server-count=3 server-edition="MemoryOptimized" storage-quota-in-mb=524288 v-cores=4 \ | ||
--standby-availability-zone "2" --tags ElasticServer="1" --resource-group "TestGroup" --name "hsctestsg" | ||
``` | ||
##### Create ##### | ||
``` | ||
az postgresqlhsc server-group create --location "westus" --create-mode "PointInTimeRestore" --enable-mx true \ | ||
--enable-zfs false --point-in-time-utc "2017-12-14T00:00:37.467Z" --source-location "eastus" \ | ||
--source-resource-group-name "SourceGroup" --source-server-group-name "pgtests-source-server-group" \ | ||
--source-subscription-id "dddddddd-dddd-dddd-dddd-dddddddddddd" --resource-group "TestGroup" --name "hsctestsg" | ||
``` | ||
##### Create ##### | ||
``` | ||
az postgresqlhsc server-group create --location "westus" --create-mode "ReadReplica" --source-location "eastus" \ | ||
--source-resource-group-name "SourceGroup" --source-server-group-name "pgtests-source-server-group" \ | ||
--source-subscription-id "dddddddd-dddd-dddd-dddd-dddddddddddd" --resource-group "TestGroup" --name "hsctestsg" | ||
``` | ||
##### Show ##### | ||
``` | ||
az postgresqlhsc server-group show --resource-group "TestGroup" --name "hsctestsg1" | ||
``` | ||
##### List ##### | ||
``` | ||
az postgresqlhsc server-group list --resource-group "TestGroup" | ||
``` | ||
##### Update ##### | ||
``` | ||
az postgresqlhsc server-group update --location "westus" --server-role-groups name="" role="Worker" server-count=10 \ | ||
--resource-group "TestGroup" --name "hsctestsg" | ||
``` | ||
##### Update ##### | ||
``` | ||
az postgresqlhsc server-group update --location "westus" --server-role-groups name="" role="Coordinator" v-cores=16 \ | ||
--resource-group "TestGroup" --name "hsctestsg" | ||
``` | ||
##### Update ##### | ||
``` | ||
az postgresqlhsc server-group update --location "westus" \ | ||
--server-role-groups name="" role="Worker" storage-quota-in-mb=8388608 --resource-group "TestGroup" \ | ||
--name "hsctestsg" | ||
``` | ||
##### Update ##### | ||
``` | ||
az postgresqlhsc server-group update \ | ||
--maintenance-window custom-window="Enabled" day-of-week=0 start-hour=8 start-minute=0 \ | ||
--resource-group "TestGroup" --name "hsctestsg" | ||
``` | ||
##### Update ##### | ||
``` | ||
az postgresqlhsc server-group update --administrator-login-password "secret" --backup-retention-days 30 \ | ||
--postgresql-version "12" \ | ||
--server-role-groups name="" enable-ha=false role="Coordinator" server-count=1 server-edition="GeneralPurpose" storage-quota-in-mb=1048576 v-cores=8 \ | ||
--server-role-groups name="" enable-ha=true role="Worker" server-count=4 server-edition="MemoryOptimized" storage-quota-in-mb=524288 v-cores=4 \ | ||
--tags ElasticServer="2" --resource-group "TestGroup" --name "hsctestsg" | ||
``` | ||
##### Restart ##### | ||
``` | ||
az postgresqlhsc server-group restart --resource-group "TestGroup" --name "hsctestsg1" | ||
``` | ||
##### Start ##### | ||
``` | ||
az postgresqlhsc server-group start --resource-group "TestGroup" --name "hsctestsg1" | ||
``` | ||
##### Stop ##### | ||
``` | ||
az postgresqlhsc server-group stop --resource-group "TestGroup" --name "hsctestsg1" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az postgresqlhsc server-group delete --resource-group "TestGroup" --name "testservergroup" | ||
``` | ||
#### postgresqlhsc server #### | ||
##### List ##### | ||
``` | ||
az postgresqlhsc server list --resource-group "TestGroup" --server-group-name "hsctestsg1" | ||
``` | ||
##### Show ##### | ||
``` | ||
az postgresqlhsc server show --resource-group "TestGroup" --server-group-name "hsctestsg1" --name "hsctestsg1-c" | ||
``` | ||
#### postgresqlhsc configuration #### | ||
##### List ##### | ||
``` | ||
az postgresqlhsc configuration list --resource-group "TestResourceGroup" --server-group-name "hsctestsg" \ | ||
--server-name "testserver" | ||
``` | ||
##### Show ##### | ||
``` | ||
az postgresqlhsc configuration show --name "array_nulls" --resource-group "TestResourceGroup" \ | ||
--server-group-name "hsctestsg" | ||
``` | ||
##### Update ##### | ||
``` | ||
az postgresqlhsc configuration update --name "array_nulls" \ | ||
--server-role-group-configurations role="Coordinator" value="on" \ | ||
--server-role-group-configurations role="Worker" value="off" --resource-group "TestResourceGroup" \ | ||
--server-group-name "hsctestsg" | ||
``` | ||
#### postgresqlhsc firewall-rule #### | ||
##### Create ##### | ||
``` | ||
az postgresqlhsc firewall-rule create --name "rule1" --end-ip-address "255.255.255.255" --start-ip-address "0.0.0.0" \ | ||
--resource-group "TestGroup" --server-group-name "pgtestsvc4" | ||
``` | ||
##### Show ##### | ||
``` | ||
az postgresqlhsc firewall-rule show --name "rule1" --resource-group "TestGroup" --server-group-name "pgtestsvc4" | ||
``` | ||
##### List ##### | ||
``` | ||
az postgresqlhsc firewall-rule list --resource-group "TestGroup" --server-group-name "pgtestsvc4" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az postgresqlhsc firewall-rule delete --name "rule1" --resource-group "TestGroup" --server-group-name "pgtestsvc4" | ||
``` | ||
#### postgresqlhsc role #### | ||
##### Create ##### | ||
``` | ||
az postgresqlhsc role create --password "secret" --resource-group "TestGroup" --name "role1" \ | ||
--server-group-name "pgtestsvc4" | ||
``` | ||
##### List ##### | ||
``` | ||
az postgresqlhsc role list --resource-group "TestGroup" --server-group-name "pgtestsvc4" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az postgresqlhsc role delete --resource-group "TestGroup" --name "role1" --server-group-name "pgtestsvc4" | ||
``` |
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,50 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 azure.cli.core import AzCommandsLoader | ||
from azext_postgresqlhsc.generated._help import helps # pylint: disable=unused-import | ||
try: | ||
from azext_postgresqlhsc.manual._help import helps # pylint: disable=reimported | ||
except ImportError: | ||
pass | ||
|
||
|
||
class MicrosoftPostgreSQLHyperscaleCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azext_postgresqlhsc.generated._client_factory import cf_postgresqlhsc_cl | ||
postgresqlhsc_custom = CliCommandType( | ||
operations_tmpl='azext_postgresqlhsc.custom#{}', | ||
client_factory=cf_postgresqlhsc_cl) | ||
parent = super(MicrosoftPostgreSQLHyperscaleCommandsLoader, self) | ||
parent.__init__(cli_ctx=cli_ctx, custom_command_type=postgresqlhsc_custom) | ||
|
||
def load_command_table(self, args): | ||
from azext_postgresqlhsc.generated.commands import load_command_table | ||
load_command_table(self, args) | ||
try: | ||
from azext_postgresqlhsc.manual.commands import load_command_table as load_command_table_manual | ||
load_command_table_manual(self, args) | ||
except ImportError: | ||
pass | ||
return self.command_table | ||
|
||
def load_arguments(self, command): | ||
from azext_postgresqlhsc.generated._params import load_arguments | ||
load_arguments(self, command) | ||
try: | ||
from azext_postgresqlhsc.manual._params import load_arguments as load_arguments_manual | ||
load_arguments_manual(self, command) | ||
except ImportError: | ||
pass | ||
|
||
|
||
COMMAND_LOADER_CLS = MicrosoftPostgreSQLHyperscaleCommandsLoader |
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,17 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
|
||
from .generated.action import * # noqa: F403 | ||
try: | ||
from .manual.action import * # noqa: F403 | ||
except ImportError: | ||
pass |
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,4 @@ | ||
{ | ||
"azext.isExperimental": true, | ||
"azext.minCliCoreVersion": "2.15.0" | ||
} |
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,17 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
|
||
from .generated.custom import * # noqa: F403 | ||
try: | ||
from .manual.custom import * # noqa: F403 | ||
except ImportError: | ||
pass |
12 changes: 12 additions & 0 deletions
12
src/postgresqlhsc/azext_postgresqlhsc/generated/__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,12 @@ | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
36 changes: 36 additions & 0 deletions
36
src/postgresqlhsc/azext_postgresqlhsc/generated/_client_factory.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,36 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
||
def cf_postgresqlhsc_cl(cli_ctx, *_): | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from azext_postgresqlhsc.vendored_sdks.postgresqlhsc import MicrosoftPostgreSQLHyperscale | ||
return get_mgmt_service_client(cli_ctx, | ||
MicrosoftPostgreSQLHyperscale) | ||
|
||
|
||
def cf_server_group(cli_ctx, *_): | ||
return cf_postgresqlhsc_cl(cli_ctx).server_groups | ||
|
||
|
||
def cf_server(cli_ctx, *_): | ||
return cf_postgresqlhsc_cl(cli_ctx).servers | ||
|
||
|
||
def cf_configuration(cli_ctx, *_): | ||
return cf_postgresqlhsc_cl(cli_ctx).configurations | ||
|
||
|
||
def cf_firewall_rule(cli_ctx, *_): | ||
return cf_postgresqlhsc_cl(cli_ctx).firewall_rules | ||
|
||
|
||
def cf_role(cli_ctx, *_): | ||
return cf_postgresqlhsc_cl(cli_ctx).roles |
Oops, something went wrong.