Skip to content

Commit

Permalink
CodeGen from PR 24354 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
update typescript.md (Azure#24354)

* update typescript.md

* update file
  • Loading branch information
SDKAuto committed Jun 21, 2023
1 parent 1abca3a commit 35a8648
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "aea36c92c00247b195efb08a0161ab74859e606e",
"commit": "453fb04aa9e602377784d62390d2985799a9efa0",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.12",
"@autorest/python@6.6.0",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/postgresqlhsc/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/postgresqlhsc/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/postgresqlhsc/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes
:vartype maintenance_window: ~azure.mgmt.cosmosdbforpostgresql.models.MaintenanceWindow
:ivar preferred_primary_zone: Preferred primary availability zone (AZ) for all cluster servers.
:vartype preferred_primary_zone: str
:ivar enable_shards_on_coordinator: If shards on coordinator is enabled or not for the cluster.
:ivar enable_shards_on_coordinator: If distributed tables are placed on coordinator or not.
Should be set to 'true' on single node clusters. Requires shard rebalancing after value is
changed.
:vartype enable_shards_on_coordinator: bool
:ivar enable_ha: If high availability (HA) is enabled or not for the cluster.
:vartype enable_ha: bool
Expand Down Expand Up @@ -295,8 +297,9 @@ def __init__( # pylint: disable=too-many-locals
:keyword preferred_primary_zone: Preferred primary availability zone (AZ) for all cluster
servers.
:paramtype preferred_primary_zone: str
:keyword enable_shards_on_coordinator: If shards on coordinator is enabled or not for the
cluster.
:keyword enable_shards_on_coordinator: If distributed tables are placed on coordinator or not.
Should be set to 'true' on single node clusters. Requires shard rebalancing after value is
changed.
:paramtype enable_shards_on_coordinator: bool
:keyword enable_ha: If high availability (HA) is enabled or not for the cluster.
:paramtype enable_ha: bool
Expand Down Expand Up @@ -408,7 +411,9 @@ class ClusterForUpdate(_serialization.Model): # pylint: disable=too-many-instan
:vartype postgresql_version: str
:ivar citus_version: The Citus extension version on all cluster servers.
:vartype citus_version: str
:ivar enable_shards_on_coordinator: If shards on coordinator is enabled or not for the cluster.
:ivar enable_shards_on_coordinator: If distributed tables are placed on coordinator or not.
Should be set to 'true' on single node clusters. Requires shard rebalancing after value is
changed.
:vartype enable_shards_on_coordinator: bool
:ivar enable_ha: If high availability (HA) is enabled or not for the cluster.
:vartype enable_ha: bool
Expand Down Expand Up @@ -493,8 +498,9 @@ def __init__(
:paramtype postgresql_version: str
:keyword citus_version: The Citus extension version on all cluster servers.
:paramtype citus_version: str
:keyword enable_shards_on_coordinator: If shards on coordinator is enabled or not for the
cluster.
:keyword enable_shards_on_coordinator: If distributed tables are placed on coordinator or not.
Should be set to 'true' on single node clusters. Requires shard rebalancing after value is
changed.
:paramtype enable_shards_on_coordinator: bool
:keyword enable_ha: If high availability (HA) is enabled or not for the cluster.
:paramtype enable_ha: bool
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdbforpostgresql import CosmosdbForPostgresqlMgmtClient

"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdbforpostgresql
# USAGE
python cluster_create_burstablev1.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""


def main():
client = CosmosdbForPostgresqlMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)

response = client.clusters.begin_create(
resource_group_name="TestGroup",
cluster_name="testcluster-burstablev1",
parameters={
"location": "westus",
"properties": {
"administratorLoginPassword": "password",
"citusVersion": "11.3",
"coordinatorEnablePublicIpAccess": True,
"coordinatorServerEdition": "BurstableMemoryOptimized",
"coordinatorStorageQuotaInMb": 131072,
"coordinatorVCores": 1,
"enableHa": False,
"enableShardsOnCoordinator": True,
"nodeCount": 0,
"postgresqlVersion": "15",
"preferredPrimaryZone": "1",
},
"tags": {"owner": "JohnDoe"},
},
).result()
print(response)


# x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateBurstablev1.json
if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdbforpostgresql import CosmosdbForPostgresqlMgmtClient

"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdbforpostgresql
# USAGE
python cluster_create_burstablev2.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""


def main():
client = CosmosdbForPostgresqlMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)

response = client.clusters.begin_create(
resource_group_name="TestGroup",
cluster_name="testcluster-burstablev2",
parameters={
"location": "westus",
"properties": {
"administratorLoginPassword": "password",
"citusVersion": "11.3",
"coordinatorEnablePublicIpAccess": True,
"coordinatorServerEdition": "BurstableGeneralPurpose",
"coordinatorStorageQuotaInMb": 131072,
"coordinatorVCores": 2,
"enableHa": False,
"enableShardsOnCoordinator": True,
"nodeCount": 0,
"postgresqlVersion": "15",
"preferredPrimaryZone": "1",
},
"tags": {"owner": "JohnDoe"},
},
).result()
print(response)


# x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateBurstablev2.json
if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
pip install azure-identity
pip install azure-mgmt-cosmosdbforpostgresql
# USAGE
python cluster_create.py
python cluster_create_multi_node.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
Expand All @@ -31,7 +31,7 @@ def main():

response = client.clusters.begin_create(
resource_group_name="TestGroup",
cluster_name="testcluster",
cluster_name="testcluster-multinode",
parameters={
"location": "westus",
"properties": {
Expand All @@ -57,6 +57,6 @@ def main():
print(response)


# x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreate.json
# x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateMultiNode.json
if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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 azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdbforpostgresql import CosmosdbForPostgresqlMgmtClient

"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdbforpostgresql
# USAGE
python cluster_create_single_node.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""


def main():
client = CosmosdbForPostgresqlMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)

response = client.clusters.begin_create(
resource_group_name="TestGroup",
cluster_name="testcluster-singlenode",
parameters={
"location": "westus",
"properties": {
"administratorLoginPassword": "password",
"citusVersion": "11.3",
"coordinatorEnablePublicIpAccess": True,
"coordinatorServerEdition": "GeneralPurpose",
"coordinatorStorageQuotaInMb": 131072,
"coordinatorVCores": 8,
"enableHa": True,
"enableShardsOnCoordinator": True,
"nodeCount": 0,
"postgresqlVersion": "15",
"preferredPrimaryZone": "1",
},
"tags": {"owner": "JohnDoe"},
},
).result()
print(response)


# x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateSingleNode.json
if __name__ == "__main__":
main()

0 comments on commit 35a8648

Please sign in to comment.