forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 7
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 24354 in Azure/azure-rest-api-specs
update typescript.md (Azure#24354) * update typescript.md * update file
- Loading branch information
SDKAuto
committed
Jun 21, 2023
1 parent
1abca3a
commit 35a8648
Showing
6 changed files
with
192 additions
and
12 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
sdk/cosmosdbforpostgresql/azure-mgmt-cosmosdbforpostgresql/_meta.json
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 |
---|---|---|
@@ -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" | ||
} |
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
58 changes: 58 additions & 0 deletions
58
...stgresql/azure-mgmt-cosmosdbforpostgresql/generated_samples/cluster_create_burstablev1.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,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() |
58 changes: 58 additions & 0 deletions
58
...stgresql/azure-mgmt-cosmosdbforpostgresql/generated_samples/cluster_create_burstablev2.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,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() |
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
58 changes: 58 additions & 0 deletions
58
...stgresql/azure-mgmt-cosmosdbforpostgresql/generated_samples/cluster_create_single_node.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,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() |