Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python autonomous_database_change_disaster_recovery_configuration.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.autonomous_databases.begin_change_disaster_recovery_configuration(
resource_group_name='rg000',
autonomousdatabasename='databasedb1',
body={'disasterRecoveryType': 'Adg', 'isReplicateAutomaticBackups': False},
).result()
print(response)

# x-ms-original-file: 2025-03-01/autonomousDatabase_changeDisasterRecoveryConfiguration.json
if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions generated_samples/autonomous_database_failover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python autonomous_database_failover.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.autonomous_databases.begin_failover(
resource_group_name='rg000',
autonomousdatabasename='databasedb1',
body={'peerDbId': 'peerDbId'},
).result()
print(response)

# x-ms-original-file: 2025-03-01/autonomousDatabase_failover.json
if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions generated_samples/autonomous_database_generate_wallet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python autonomous_database_generate_wallet.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.autonomous_databases.generate_wallet(
resource_group_name='rg000',
autonomousdatabasename='databasedb1',
body={'generateType': 'Single', 'isRegional': False, 'password': '********'},
)
print(response)

# x-ms-original-file: 2025-03-01/autonomousDatabase_generateWallet.json
if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions generated_samples/autonomous_database_restore.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python autonomous_database_restore.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.autonomous_databases.begin_restore(
resource_group_name='rg000',
autonomousdatabasename='databasedb1',
body={'timestamp': '2024-04-23T00:00:00.000Z'},
).result()
print(response)

# x-ms-original-file: 2025-03-01/autonomousDatabase_restore.json
if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions generated_samples/autonomous_database_switchover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python autonomous_database_switchover.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.autonomous_databases.begin_switchover(
resource_group_name='rg000',
autonomousdatabasename='databasedb1',
body={'peerDbId': 'peerDbId'},
).result()
print(response)

# x-ms-original-file: 2025-03-01/autonomousDatabase_switchover.json
if __name__ == "__main__":
main()
40 changes: 40 additions & 0 deletions generated_samples/db_nodes_action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python db_nodes_action.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.db_nodes.begin_action(
resource_group_name='rg000',
cloudvmclustername='cluster1',
dbnodeocid='ocid1....aaaaaa',
body={'action': 'Start'},
).result()
print(response)

# x-ms-original-file: 2025-03-01/dbNodes_action.json
if __name__ == "__main__":
main()
38 changes: 38 additions & 0 deletions generated_samples/db_system_shapes_list_by_location.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python db_system_shapes_list_by_location.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.db_system_shapes.list_by_location(
location='eastus',
)
for item in response:
print(item)

# x-ms-original-file: 2025-03-01/dbSystemShapes_listByLocation.json
if __name__ == "__main__":
main()
38 changes: 38 additions & 0 deletions generated_samples/exa_infra_add_storage_capacity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python exa_infra_add_storage_capacity.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.cloud_exadata_infrastructures.begin_add_storage_capacity(
resource_group_name='rg000',
cloudexadatainfrastructurename='infra1',
).result()
print(response)

# x-ms-original-file: 2025-03-01/exaInfra_addStorageCapacity.json
if __name__ == "__main__":
main()
39 changes: 39 additions & 0 deletions generated_samples/exadb_vm_clusters_remove_vms_maximum_set_gen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python exadb_vm_clusters_remove_vms_maximum_set_gen.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.exadb_vm_clusters.begin_remove_vms(
resource_group_name='rgopenapi',
exadb_vm_cluster_name='vmClusterName',
body={'dbNodes': [{'dbNodeId': '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Oracle.Database/exadbVmClusters/vmCluster/dbNodes/dbNodeName'}]},
).result()
print(response)

# x-ms-original-file: 2025-03-01/ExadbVmClusters_RemoveVms_MaximumSet_Gen.json
if __name__ == "__main__":
main()
40 changes: 40 additions & 0 deletions generated_samples/exascale_db_nodes_action_maximum_set_gen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.identity import DefaultAzureCredential

from azure.mgmt.oracledatabase import OracleDatabaseMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-oracledatabase
# USAGE
python exascale_db_nodes_action_maximum_set_gen.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 = OracleDatabaseMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)

response = client.exascale_db_nodes.begin_action(
resource_group_name='rgopenapi',
exadb_vm_cluster_name='vmClusterName',
exascale_db_node_name='dbNodeName',
body={'action': 'Start'},
).result()
print(response)

# x-ms-original-file: 2025-03-01/ExascaleDbNodes_Action_MaximumSet_Gen.json
if __name__ == "__main__":
main()
Loading