From bcc934f6648d1fdb13613631652ba40599d5d75a Mon Sep 17 00:00:00 2001 From: OCI DEX Release Bot Automation Date: Tue, 11 Aug 2026 12:37:04 +0000 Subject: [PATCH] Releasing version 3.90.2 Co-authored-by: Harsh Kumar --- CHANGELOG.rst | 69 + requirements.txt | 2 +- .../generated/database_cli.py | 222 ++- services/ddfs/__init__.py | 4 + services/ddfs/src/__init__.py | 4 + .../ddfs/src/oci_cli_instance/__init__.py | 4 + .../oci_cli_instance/generated/__init__.py | 4 + .../generated/client_mappings.py | 14 + .../generated/instance_cli.py | 639 +++++++ .../oci_cli_instance/instance_cli_extended.py | 27 + services/ddfs/tests/__init__.py | 4 + .../tests/util/generated/command_to_api.py | 16 + services/distributed_database_v26/__init__.py | 4 + .../distributed_database_v26/src/__init__.py | 4 + .../__init__.py | 4 + .../generated/__init__.py | 4 + .../generated/client_mappings.py | 14 + .../distributedautonomousdbservice_cli.py | 1489 +++++++++++++++++ .../__init__.py | 4 + .../generated/__init__.py | 4 + .../distributed_database_v26_service_cli.py | 14 + .../__init__.py | 4 + .../generated/__init__.py | 4 + .../generated/client_mappings.py | 14 + ...distributeddbprivateendpointservice_cli.py | 515 ++++++ .../__init__.py | 4 + .../generated/__init__.py | 4 + .../generated/client_mappings.py | 14 + .../generated/distributeddbservice_cli.py | 1364 +++++++++++++++ .../__init__.py | 4 + .../generated/__init__.py | 4 + .../generated/client_mappings.py | 14 + .../distributeddbworkrequestservice_cli.py | 245 +++ .../tests/__init__.py | 4 + .../tests/util/generated/command_to_api.py | 9 + .../generated/generativeai_cli.py | 2 +- .../generated/objectstorage_cli.py | 12 +- .../get_object_tasks.py | 2 + .../objectstorage_cli_extended.py | 1 + .../tests/unit/test_get_object_tasks.py | 77 + .../generated/resourcemanager_cli.py | 65 + .../tests/util/generated/command_to_api.py | 2 + .../generated/schedule_cli.py | 12 +- setup.py | 2 +- src/oci_cli/service_mapping.py | 14 +- src/oci_cli/version.py | 2 +- 46 files changed, 4910 insertions(+), 34 deletions(-) create mode 100644 services/ddfs/__init__.py create mode 100644 services/ddfs/src/__init__.py create mode 100644 services/ddfs/src/oci_cli_instance/__init__.py create mode 100644 services/ddfs/src/oci_cli_instance/generated/__init__.py create mode 100644 services/ddfs/src/oci_cli_instance/generated/client_mappings.py create mode 100644 services/ddfs/src/oci_cli_instance/generated/instance_cli.py create mode 100644 services/ddfs/src/oci_cli_instance/instance_cli_extended.py create mode 100644 services/ddfs/tests/__init__.py create mode 100644 services/ddfs/tests/util/generated/command_to_api.py create mode 100644 services/distributed_database_v26/__init__.py create mode 100644 services/distributed_database_v26/src/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/client_mappings.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/distributedautonomousdbservice_cli.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_database_v26/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/distributed_database_v26_service_cli.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/client_mappings.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/distributeddbprivateendpointservice_cli.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_service/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/client_mappings.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/distributeddbservice_cli.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/__init__.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/client_mappings.py create mode 100644 services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/distributeddbworkrequestservice_cli.py create mode 100644 services/distributed_database_v26/tests/__init__.py create mode 100644 services/distributed_database_v26/tests/util/generated/command_to_api.py create mode 100644 services/object_storage/tests/unit/test_get_object_tasks.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0c3246c30..c07bef294 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,75 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `__. +3.90.2 - 2026-08-11 +------------------- +Added +~~~~~ +* Globally Distributed Database Service + + * Support for the Globally Distributed Database service + + * ``oci distributed-database-v26`` + +* Resource Manager Service + + * Support for retrieving WorkRequestLogEntries and WorkRequestLogEntriesContent + + * ``oci resource-manager work-request get-work-request-log-entries`` + * ``oci resource-manager work-request get-work-request-log-entries-content`` + +* Resource Scheduler Service + + * Support for new optional parameter ``--local-time-zone`` + + * ``oci resource-scheduler schedule create --local-time-zone`` + * ``oci resource-scheduler schedule update --local-time-zone`` + +* Device Data FHIR Service + + * Support for the Device Data FHIR Service + + * ``oci ddfs`` + +* Database Service + + * Support for Autonomous Database Serverless availability domain selection during provisioning and post-provisioning updates + + * ``oci db autonomous-database create --availability-domain`` + * ``oci db autonomous-database create-adb-cross-region-data-guard-details --availability-domain`` + * ``oci db autonomous-database create-autonomous-database-create-cross-region-disaster-recovery-details --availability-domain`` + * ``oci db autonomous-database create-autonomous-database-gcp-key-details --availability-domain`` + * ``oci db autonomous-database create-autonomous-database-undelete-autonomous-database-details --availability-domain`` + * ``oci db autonomous-database create-cross-tenancy-disaster-recovery-details --availability-domain`` + * ``oci db autonomous-database create-from-backup-id --availability-domain`` + * ``oci db autonomous-database create-from-backup-timestamp --availability-domain`` + * ``oci db autonomous-database create-from-clone --availability-domain`` + * ``oci db autonomous-database create-refreshable-clone --availability-domain`` + * ``oci db autonomous-database update --availability-domain --time-scheduled-ad-update --is-disable-ad-update-schedule --is-schedule-ad-update-to-earliest`` + * ``oci db autonomous-database update-autonomous-database-aws-key-details --availability-domain --time-scheduled-ad-update --is-disable-ad-update-schedule --is-schedule-ad-update-to-earliest`` + * ``oci db autonomous-database update-autonomous-database-azure-key-details --availability-domain --time-scheduled-ad-update --is-disable-ad-update-schedule --is-schedule-ad-update-to-earliest`` + * ``oci db autonomous-database update-autonomous-database-gcp-key-details --availability-domain --time-scheduled-ad-update --is-disable-ad-update-schedule --is-schedule-ad-update-to-earliest`` + * ``oci db autonomous-database update-autonomous-database-oci-key-details --availability-domain --time-scheduled-ad-update --is-disable-ad-update-schedule --is-schedule-ad-update-to-earliest`` + * ``oci db autonomous-database update-autonomous-database-okv-key-details --availability-domain --time-scheduled-ad-update --is-disable-ad-update-schedule --is-schedule-ad-update-to-earliest`` + * ``oci db autonomous-database update-autonomous-database-oracle-managed-key-details --availability-domain --time-scheduled-ad-update --is-disable-ad-update-schedule --is-schedule-ad-update-to-earliest`` + +* Compute Service + + * Support for Quick Recycle Settings in Compute Host Group commands + + * ``oci compute compute-host-group create`` + * ``oci compute compute-host-group update`` + +* Generative AI Service + + * Support for additional B300 unit shapes in Generative AI Service + + * ``oci generative-ai dedicated-ai-cluster create --unit-shape`` + +* Object Storage Service + + * Support for IPv6 dual stack endpoints in Object Storage Service + 3.90.1 - 2026-08-04 ------------------- Added diff --git a/requirements.txt b/requirements.txt index 5151bafd4..0bc747316 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ Jinja2>=3.1.5,<4.0.0; python_version >= '3.7' jmespath>=0.10.0,<=1.0.1 ndg-httpsclient==0.4.2 mock==2.0.0 -oci==2.184.0 +oci==2.184.1 packaging==20.2; python_version < '3.7' packaging>=21.0,<25.0; python_version >= '3.7' and python_version < '3.9' packaging>=22.0,<25.0; python_version >= '3.9' diff --git a/services/database/src/oci_cli_database/generated/database_cli.py b/services/database/src/oci_cli_database/generated/database_cli.py index 2158d54c1..c1e971fd8 100644 --- a/services/database/src/oci_cli_database/generated/database_cli.py +++ b/services/database/src/oci_cli_database/generated/database_cli.py @@ -6766,6 +6766,7 @@ def create_autonomous_container_database_dataguard_association(ctx, from_json, w @autonomous_database_group.command(name=cli_util.override('db.create_autonomous_database.command_name', 'create'), help=u"""Creates a new Autonomous AI Database. \n[Command Reference](createAutonomousDatabase)""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment of the Autonomous AI Database.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -6897,7 +6898,7 @@ def create_autonomous_container_database_dataguard_association(ctx, from_json, w @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, source, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, source, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -6910,6 +6911,9 @@ def create_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -7107,6 +7111,7 @@ def create_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment of the Autonomous AI Database.""") @cli_util.option('--source-id', required=True, help=u"""The [OCID] of the Autonomous AI Database that you want to undelete.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -7235,7 +7240,7 @@ def create_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_undelete_autonomous_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database_undelete_autonomous_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -7249,6 +7254,9 @@ def create_autonomous_database_undelete_autonomous_database_details(ctx, from_js if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -7446,6 +7454,7 @@ def create_autonomous_database_undelete_autonomous_database_details(ctx, from_js @cli_util.option('--source-id', required=True, help=u"""The [OCID] of the source Autonomous AI Database that you will clone to create a new Autonomous AI Database.""") @cli_util.option('--clone-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "METADATA", "PARTIAL"]), help=u"""The Autonomous AI Database clone type.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -7574,7 +7583,7 @@ def create_autonomous_database_undelete_autonomous_database_details(ctx, from_js @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_autonomous_database_clone_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, clone_type, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database_create_autonomous_database_clone_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, clone_type, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -7589,6 +7598,9 @@ def create_autonomous_database_create_autonomous_database_clone_details(ctx, fro if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -7785,6 +7797,7 @@ def create_autonomous_database_create_autonomous_database_clone_details(ctx, fro @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment of the Autonomous AI Database.""") @cli_util.option('--source-id', required=True, help=u"""The [OCID] of the source Autonomous AI Database that you will clone to create a new Autonomous AI Database.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -7921,7 +7934,7 @@ def create_autonomous_database_create_autonomous_database_clone_details(ctx, fro @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_refreshable_autonomous_database_clone_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, refreshable_mode, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, open_mode, clone_type, opc_dry_run): +def create_autonomous_database_create_refreshable_autonomous_database_clone_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, refreshable_mode, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, open_mode, clone_type, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -7935,6 +7948,9 @@ def create_autonomous_database_create_refreshable_autonomous_database_clone_deta if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -8150,6 +8166,7 @@ def create_autonomous_database_create_refreshable_autonomous_database_clone_deta @cli_util.option('--autonomous-database-backup-id', required=True, help=u"""The [OCID] of the source Autonomous AI Database Backup that you will clone to create a new Autonomous AI Database.""") @cli_util.option('--clone-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "METADATA", "PARTIAL"]), help=u"""The Autonomous AI Database clone type.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -8279,7 +8296,7 @@ def create_autonomous_database_create_refreshable_autonomous_database_clone_deta @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}, 'clone-table-space-list': {'module': 'database', 'class': 'list[integer]'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_autonomous_database_from_backup_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, autonomous_database_backup_id, clone_type, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, clone_table_space_list, opc_dry_run): +def create_autonomous_database_create_autonomous_database_from_backup_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, autonomous_database_backup_id, clone_type, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, clone_table_space_list, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -8294,6 +8311,9 @@ def create_autonomous_database_create_autonomous_database_from_backup_details(ct if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -8494,6 +8514,7 @@ def create_autonomous_database_create_autonomous_database_from_backup_details(ct @cli_util.option('--source-id', required=True, help=u"""The [OCID] of the source Autonomous AI Database that will be used to create a new peer database for the DR association.""") @cli_util.option('--remote-disaster-recovery-type', required=True, help=u"""Indicates the cross-region disaster recovery (DR) type of the standby Autonomous AI Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -8623,7 +8644,7 @@ def create_autonomous_database_create_autonomous_database_from_backup_details(ct @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_cross_region_disaster_recovery_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, remote_disaster_recovery_type, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, is_replicate_automatic_backups, opc_dry_run): +def create_autonomous_database_create_cross_region_disaster_recovery_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, remote_disaster_recovery_type, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, is_replicate_automatic_backups, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -8638,6 +8659,9 @@ def create_autonomous_database_create_cross_region_disaster_recovery_details(ctx if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -8838,6 +8862,7 @@ def create_autonomous_database_create_cross_region_disaster_recovery_details(ctx @cli_util.option('--autonomous-database-id', required=True, help=u"""The [OCID] of the source Autonomous AI Database that you will clone to create a new Autonomous AI Database.""") @cli_util.option('--clone-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL", "METADATA", "PARTIAL"]), help=u"""The Autonomous AI Database clone type.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -8969,7 +8994,7 @@ def create_autonomous_database_create_cross_region_disaster_recovery_details(ctx @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}, 'clone-table-space-list': {'module': 'database', 'class': 'list[integer]'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_autonomous_database_from_backup_timestamp_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, autonomous_database_id, clone_type, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, timestamp, use_latest_available_backup_time_stamp, clone_table_space_list, opc_dry_run): +def create_autonomous_database_create_autonomous_database_from_backup_timestamp_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, autonomous_database_id, clone_type, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, timestamp, use_latest_available_backup_time_stamp, clone_table_space_list, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -8984,6 +9009,9 @@ def create_autonomous_database_create_autonomous_database_from_backup_timestamp_ if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -9190,6 +9218,7 @@ def create_autonomous_database_create_autonomous_database_from_backup_timestamp_ @cli_util.option('--source-id', required=True, help=u"""The [OCID] of the source Autonomous AI Database that will be used to create a new peer database for the DR association.""") @cli_util.option('--disaster-recovery-type', required=True, help=u"""Indicates the disaster recovery (DR) type of the standby Autonomous AI Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -9319,7 +9348,7 @@ def create_autonomous_database_create_autonomous_database_from_backup_timestamp_ @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_cross_tenancy_disaster_recovery_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, disaster_recovery_type, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, is_replicate_automatic_backups, opc_dry_run): +def create_autonomous_database_create_cross_tenancy_disaster_recovery_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, disaster_recovery_type, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, is_replicate_automatic_backups, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -9334,6 +9363,9 @@ def create_autonomous_database_create_cross_tenancy_disaster_recovery_details(ct if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -9533,6 +9565,7 @@ def create_autonomous_database_create_cross_tenancy_disaster_recovery_details(ct @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment of the Autonomous AI Database.""") @cli_util.option('--source-id', required=True, help=u"""The [OCID] of the source Autonomous AI Database that will be used to create a new peer database for the Data Guard association.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -9661,7 +9694,7 @@ def create_autonomous_database_create_cross_tenancy_disaster_recovery_details(ct @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_cross_region_autonomous_database_data_guard_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database_create_cross_region_autonomous_database_data_guard_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, source_id, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -9675,6 +9708,9 @@ def create_autonomous_database_create_cross_region_autonomous_database_data_guar if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -9870,6 +9906,7 @@ def create_autonomous_database_create_cross_region_autonomous_database_data_guar @autonomous_database_group.command(name=cli_util.override('db.create_autonomous_database_create_autonomous_database_details.command_name', 'create-autonomous-database-create-autonomous-database-details'), help=u"""Creates a new Autonomous AI Database. \n[Command Reference](createAutonomousDatabase)""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment of the Autonomous AI Database.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -9998,7 +10035,7 @@ def create_autonomous_database_create_cross_region_autonomous_database_data_guar @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_create_autonomous_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database_create_autonomous_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, encryption_key, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -10011,6 +10048,9 @@ def create_autonomous_database_create_autonomous_database_details(ctx, from_json if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -10210,6 +10250,7 @@ def create_autonomous_database_create_autonomous_database_details(ctx, from_json @cli_util.option('--encryption-key-directory-name', required=True, help=u"""OKV wallet directory name""") @cli_util.option('--encryption-key-certificate-directory-name', required=True, help=u"""OKV certificate directory name""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -10338,7 +10379,7 @@ def create_autonomous_database_create_autonomous_database_details(ctx, from_json @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_okv_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_okv_uri, encryption_key_okv_kms_key, encryption_key_directory_name, encryption_key_certificate_directory_name, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run, encryption_key_certificate_id): +def create_autonomous_database_okv_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_okv_uri, encryption_key_okv_kms_key, encryption_key_directory_name, encryption_key_certificate_directory_name, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run, encryption_key_certificate_id): kwargs = {} if opc_dry_run is not None: @@ -10356,6 +10397,9 @@ def create_autonomous_database_okv_key_details(ctx, from_json, wait_for_state, m if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -10553,6 +10597,7 @@ def create_autonomous_database_okv_key_details(ctx, from_json, wait_for_state, m @cli_util.option('--encryption-key-vault-uri', required=True, help=u"""Azure vault URI""") @cli_util.option('--encryption-key-key-name', required=True, help=u"""Azure key name""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -10680,7 +10725,7 @@ def create_autonomous_database_okv_key_details(ctx, from_json, wait_for_state, m @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_azure_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_vault_uri, encryption_key_key_name, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database_azure_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_vault_uri, encryption_key_key_name, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -10696,6 +10741,9 @@ def create_autonomous_database_azure_key_details(ctx, from_json, wait_for_state, if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -10890,6 +10938,7 @@ def create_autonomous_database_azure_key_details(ctx, from_json, wait_for_state, @cli_util.option('--encryption-key-service-endpoint-uri', required=True, help=u"""AWS key service endpoint URI""") @cli_util.option('--encryption-key-key-arn', required=True, help=u"""AWS key ARN""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -11019,7 +11068,7 @@ def create_autonomous_database_azure_key_details(ctx, from_json, wait_for_state, @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_aws_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_service_endpoint_uri, encryption_key_key_arn, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run, encryption_key_arn_role, encryption_key_external_id): +def create_autonomous_database_aws_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_service_endpoint_uri, encryption_key_key_arn, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run, encryption_key_arn_role, encryption_key_external_id): kwargs = {} if opc_dry_run is not None: @@ -11035,6 +11084,9 @@ def create_autonomous_database_aws_key_details(ctx, from_json, wait_for_state, m if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -11235,6 +11287,7 @@ def create_autonomous_database_aws_key_details(ctx, from_json, wait_for_state, m @cli_util.option('--encryption-key-kms-key-id', required=True, help=u"""The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.""") @cli_util.option('--encryption-key-vault-id', required=True, help=u"""The [OCID] of the Oracle Cloud Infrastructure [vault]. This parameter and `secretId` are required for Customer Managed Keys.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -11362,7 +11415,7 @@ def create_autonomous_database_aws_key_details(ctx, from_json, wait_for_state, m @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_oci_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_kms_key_id, encryption_key_vault_id, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database_oci_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_kms_key_id, encryption_key_vault_id, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -11378,6 +11431,9 @@ def create_autonomous_database_oci_key_details(ctx, from_json, wait_for_state, m if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -11574,6 +11630,7 @@ def create_autonomous_database_oci_key_details(ctx, from_json, wait_for_state, m @cli_util.option('--encryption-key-location', required=True, help=u"""GCP key ring location""") @cli_util.option('--encryption-key-key-ring', required=True, help=u"""GCP key ring""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -11702,7 +11759,7 @@ def create_autonomous_database_oci_key_details(ctx, from_json, wait_for_state, m @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_gcp_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_key_name, encryption_key_project, encryption_key_location, encryption_key_key_ring, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run, encryption_key_kms_rest_endpoint): +def create_autonomous_database_gcp_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, encryption_key_key_name, encryption_key_project, encryption_key_location, encryption_key_key_ring, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run, encryption_key_kms_rest_endpoint): kwargs = {} if opc_dry_run is not None: @@ -11720,6 +11777,9 @@ def create_autonomous_database_gcp_key_details(ctx, from_json, wait_for_state, m if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -11915,6 +11975,7 @@ def create_autonomous_database_gcp_key_details(ctx, from_json, wait_for_state, m @autonomous_database_group.command(name=cli_util.override('db.create_autonomous_database_oracle_managed_key_details.command_name', 'create-autonomous-database-oracle-managed-key-details'), help=u"""Creates a new Autonomous AI Database. \n[Command Reference](createAutonomousDatabase)""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment of the Autonomous AI Database.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") @cli_util.option('--character-set', help=u"""The character set for the Autonomous AI Database. The default is AL32UTF8. Allowed values for an Autonomous AI Database Serverless instance as as returned by [List Autonomous AI Database Character Sets] For an Autonomous AI Database on dedicated infrastructure, the allowed values are: @@ -12042,7 +12103,7 @@ def create_autonomous_database_gcp_key_details(ctx, from_json, wait_for_state, m @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'transportable-tablespace': {'module': 'database', 'class': 'ImportTransportableTablespaceDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def create_autonomous_database_oracle_managed_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subscription_id, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): +def create_autonomous_database_oracle_managed_key_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subscription_id, availability_domain, character_set, ncharacter_set, db_name, cpu_core_count, backup_retention_period_in_days, compute_model, compute_count, ocpu_count, db_workload, data_storage_size_in_tbs, data_storage_size_in_gbs, is_free_tier, kms_key_id, vault_id, admin_password, display_name, license_model, byol_compute_count_limit, is_preview_version_with_service_terms_accepted, is_auto_scaling_enabled, is_dev_tier, is_dedicated, autonomous_container_database_id, in_memory_percentage, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_data_guard_enabled, is_local_data_guard_enabled, subnet_id, nsg_ids, private_endpoint_label, freeform_tags, defined_tags, security_attributes, private_endpoint_ip, db_version, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, is_backup_retention_locked, secret_id, secret_version_number, transportable_tablespace, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -12056,6 +12117,9 @@ def create_autonomous_database_oracle_managed_key_details(ctx, from_json, wait_f if subscription_id is not None: _details['subscriptionId'] = subscription_id + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + if character_set is not None: _details['characterSet'] = character_set @@ -35861,6 +35925,10 @@ def update_autonomous_container_database_dataguard_association(ctx, from_json, w @cli_util.option('--is-free-tier', type=click.BOOL, help=u"""Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous AI Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") +@cli_util.option('--time-scheduled-ad-update', type=custom_types.CLI_DATETIME, help=u"""The date and time when the Autonomous Database availability domain is to be updated.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--is-disable-ad-update-schedule', type=click.BOOL, help=u"""True, if you want to disable Autonomous Database availability domain scheduled update.""") +@cli_util.option('--is-schedule-ad-update-to-earliest', type=click.BOOL, help=u"""True, if you want to schedule Autonomous Database availability domain update to the earliest available time.""") @cli_util.option('--admin-password', help=u"""The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. This cannot be used in conjunction with with OCI vault secrets (secretId). @@ -36001,7 +36069,7 @@ def update_autonomous_container_database_dataguard_association(ctx, from_json, w @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'long-term-backup-schedule': {'module': 'database', 'class': 'LongTermBackUpScheduleDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'vanity-url-details': {'module': 'database', 'class': 'VanityUrlDetails'}, 'encryption-key': {'module': 'database', 'class': 'AutonomousDatabaseEncryptionKeyDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, encryption_key, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): +def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, availability_domain, time_scheduled_ad_update, is_disable_ad_update_schedule, is_schedule_ad_update_to_earliest, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, encryption_key, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): if isinstance(autonomous_database_id, six.string_types) and len(autonomous_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-database-id cannot be whitespace or empty string') @@ -36058,6 +36126,18 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s if is_free_tier is not None: _details['isFreeTier'] = is_free_tier + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + + if time_scheduled_ad_update is not None: + _details['timeScheduledAdUpdate'] = time_scheduled_ad_update + + if is_disable_ad_update_schedule is not None: + _details['isDisableAdUpdateSchedule'] = is_disable_ad_update_schedule + + if is_schedule_ad_update_to_earliest is not None: + _details['isScheduleAdUpdateToEarliest'] = is_schedule_ad_update_to_earliest + if admin_password is not None: _details['adminPassword'] = admin_password @@ -36278,6 +36358,10 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s @cli_util.option('--is-free-tier', type=click.BOOL, help=u"""Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous AI Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") +@cli_util.option('--time-scheduled-ad-update', type=custom_types.CLI_DATETIME, help=u"""The date and time when the Autonomous Database availability domain is to be updated.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--is-disable-ad-update-schedule', type=click.BOOL, help=u"""True, if you want to disable Autonomous Database availability domain scheduled update.""") +@cli_util.option('--is-schedule-ad-update-to-earliest', type=click.BOOL, help=u"""True, if you want to schedule Autonomous Database availability domain update to the earliest available time.""") @cli_util.option('--admin-password', help=u"""The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. This cannot be used in conjunction with with OCI vault secrets (secretId). @@ -36418,7 +36502,7 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'long-term-backup-schedule': {'module': 'database', 'class': 'LongTermBackUpScheduleDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'vanity-url-details': {'module': 'database', 'class': 'VanityUrlDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_okv_uri, encryption_key_okv_kms_key, encryption_key_directory_name, encryption_key_certificate_directory_name, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run, encryption_key_certificate_id): +def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_okv_uri, encryption_key_okv_kms_key, encryption_key_directory_name, encryption_key_certificate_directory_name, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, availability_domain, time_scheduled_ad_update, is_disable_ad_update_schedule, is_schedule_ad_update_to_earliest, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run, encryption_key_certificate_id): if isinstance(autonomous_database_id, six.string_types) and len(autonomous_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-database-id cannot be whitespace or empty string') @@ -36480,6 +36564,18 @@ def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_s if is_free_tier is not None: _details['isFreeTier'] = is_free_tier + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + + if time_scheduled_ad_update is not None: + _details['timeScheduledAdUpdate'] = time_scheduled_ad_update + + if is_disable_ad_update_schedule is not None: + _details['isDisableAdUpdateSchedule'] = is_disable_ad_update_schedule + + if is_schedule_ad_update_to_earliest is not None: + _details['isScheduleAdUpdateToEarliest'] = is_schedule_ad_update_to_earliest + if admin_password is not None: _details['adminPassword'] = admin_password @@ -36700,6 +36796,10 @@ def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_s @cli_util.option('--is-free-tier', type=click.BOOL, help=u"""Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous AI Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") +@cli_util.option('--time-scheduled-ad-update', type=custom_types.CLI_DATETIME, help=u"""The date and time when the Autonomous Database availability domain is to be updated.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--is-disable-ad-update-schedule', type=click.BOOL, help=u"""True, if you want to disable Autonomous Database availability domain scheduled update.""") +@cli_util.option('--is-schedule-ad-update-to-earliest', type=click.BOOL, help=u"""True, if you want to schedule Autonomous Database availability domain update to the earliest available time.""") @cli_util.option('--admin-password', help=u"""The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. This cannot be used in conjunction with with OCI vault secrets (secretId). @@ -36839,7 +36939,7 @@ def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_s @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'long-term-backup-schedule': {'module': 'database', 'class': 'LongTermBackUpScheduleDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'vanity-url-details': {'module': 'database', 'class': 'VanityUrlDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_vault_uri, encryption_key_key_name, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): +def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_vault_uri, encryption_key_key_name, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, availability_domain, time_scheduled_ad_update, is_disable_ad_update_schedule, is_schedule_ad_update_to_earliest, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): if isinstance(autonomous_database_id, six.string_types) and len(autonomous_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-database-id cannot be whitespace or empty string') @@ -36899,6 +36999,18 @@ def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for if is_free_tier is not None: _details['isFreeTier'] = is_free_tier + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + + if time_scheduled_ad_update is not None: + _details['timeScheduledAdUpdate'] = time_scheduled_ad_update + + if is_disable_ad_update_schedule is not None: + _details['isDisableAdUpdateSchedule'] = is_disable_ad_update_schedule + + if is_schedule_ad_update_to_earliest is not None: + _details['isScheduleAdUpdateToEarliest'] = is_schedule_ad_update_to_earliest + if admin_password is not None: _details['adminPassword'] = admin_password @@ -37116,6 +37228,10 @@ def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for @cli_util.option('--is-free-tier', type=click.BOOL, help=u"""Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous AI Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") +@cli_util.option('--time-scheduled-ad-update', type=custom_types.CLI_DATETIME, help=u"""The date and time when the Autonomous Database availability domain is to be updated.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--is-disable-ad-update-schedule', type=click.BOOL, help=u"""True, if you want to disable Autonomous Database availability domain scheduled update.""") +@cli_util.option('--is-schedule-ad-update-to-earliest', type=click.BOOL, help=u"""True, if you want to schedule Autonomous Database availability domain update to the earliest available time.""") @cli_util.option('--admin-password', help=u"""The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. This cannot be used in conjunction with with OCI vault secrets (secretId). @@ -37257,7 +37373,7 @@ def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'long-term-backup-schedule': {'module': 'database', 'class': 'LongTermBackUpScheduleDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'vanity-url-details': {'module': 'database', 'class': 'VanityUrlDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_service_endpoint_uri, encryption_key_key_arn, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run, encryption_key_arn_role, encryption_key_external_id): +def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_service_endpoint_uri, encryption_key_key_arn, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, availability_domain, time_scheduled_ad_update, is_disable_ad_update_schedule, is_schedule_ad_update_to_earliest, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run, encryption_key_arn_role, encryption_key_external_id): if isinstance(autonomous_database_id, six.string_types) and len(autonomous_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-database-id cannot be whitespace or empty string') @@ -37317,6 +37433,18 @@ def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_s if is_free_tier is not None: _details['isFreeTier'] = is_free_tier + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + + if time_scheduled_ad_update is not None: + _details['timeScheduledAdUpdate'] = time_scheduled_ad_update + + if is_disable_ad_update_schedule is not None: + _details['isDisableAdUpdateSchedule'] = is_disable_ad_update_schedule + + if is_schedule_ad_update_to_earliest is not None: + _details['isScheduleAdUpdateToEarliest'] = is_schedule_ad_update_to_earliest + if admin_password is not None: _details['adminPassword'] = admin_password @@ -37540,6 +37668,10 @@ def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_s @cli_util.option('--is-free-tier', type=click.BOOL, help=u"""Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous AI Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") +@cli_util.option('--time-scheduled-ad-update', type=custom_types.CLI_DATETIME, help=u"""The date and time when the Autonomous Database availability domain is to be updated.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--is-disable-ad-update-schedule', type=click.BOOL, help=u"""True, if you want to disable Autonomous Database availability domain scheduled update.""") +@cli_util.option('--is-schedule-ad-update-to-earliest', type=click.BOOL, help=u"""True, if you want to schedule Autonomous Database availability domain update to the earliest available time.""") @cli_util.option('--admin-password', help=u"""The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. This cannot be used in conjunction with with OCI vault secrets (secretId). @@ -37679,7 +37811,7 @@ def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_s @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'long-term-backup-schedule': {'module': 'database', 'class': 'LongTermBackUpScheduleDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'vanity-url-details': {'module': 'database', 'class': 'VanityUrlDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_kms_key_id, encryption_key_vault_id, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): +def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_kms_key_id, encryption_key_vault_id, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, availability_domain, time_scheduled_ad_update, is_disable_ad_update_schedule, is_schedule_ad_update_to_earliest, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): if isinstance(autonomous_database_id, six.string_types) and len(autonomous_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-database-id cannot be whitespace or empty string') @@ -37739,6 +37871,18 @@ def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_s if is_free_tier is not None: _details['isFreeTier'] = is_free_tier + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + + if time_scheduled_ad_update is not None: + _details['timeScheduledAdUpdate'] = time_scheduled_ad_update + + if is_disable_ad_update_schedule is not None: + _details['isDisableAdUpdateSchedule'] = is_disable_ad_update_schedule + + if is_schedule_ad_update_to_earliest is not None: + _details['isScheduleAdUpdateToEarliest'] = is_schedule_ad_update_to_earliest + if admin_password is not None: _details['adminPassword'] = admin_password @@ -37958,6 +38102,10 @@ def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_s @cli_util.option('--is-free-tier', type=click.BOOL, help=u"""Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous AI Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") +@cli_util.option('--time-scheduled-ad-update', type=custom_types.CLI_DATETIME, help=u"""The date and time when the Autonomous Database availability domain is to be updated.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--is-disable-ad-update-schedule', type=click.BOOL, help=u"""True, if you want to disable Autonomous Database availability domain scheduled update.""") +@cli_util.option('--is-schedule-ad-update-to-earliest', type=click.BOOL, help=u"""True, if you want to schedule Autonomous Database availability domain update to the earliest available time.""") @cli_util.option('--admin-password', help=u"""The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. This cannot be used in conjunction with with OCI vault secrets (secretId). @@ -38098,7 +38246,7 @@ def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_s @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'long-term-backup-schedule': {'module': 'database', 'class': 'LongTermBackUpScheduleDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'vanity-url-details': {'module': 'database', 'class': 'VanityUrlDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_key_name, encryption_key_project, encryption_key_location, encryption_key_key_ring, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run, encryption_key_kms_rest_endpoint): +def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, encryption_key_key_name, encryption_key_project, encryption_key_location, encryption_key_key_ring, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, availability_domain, time_scheduled_ad_update, is_disable_ad_update_schedule, is_schedule_ad_update_to_earliest, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run, encryption_key_kms_rest_endpoint): if isinstance(autonomous_database_id, six.string_types) and len(autonomous_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-database-id cannot be whitespace or empty string') @@ -38160,6 +38308,18 @@ def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_s if is_free_tier is not None: _details['isFreeTier'] = is_free_tier + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + + if time_scheduled_ad_update is not None: + _details['timeScheduledAdUpdate'] = time_scheduled_ad_update + + if is_disable_ad_update_schedule is not None: + _details['isDisableAdUpdateSchedule'] = is_disable_ad_update_schedule + + if is_schedule_ad_update_to_earliest is not None: + _details['isScheduleAdUpdateToEarliest'] = is_schedule_ad_update_to_earliest + if admin_password is not None: _details['adminPassword'] = admin_password @@ -38378,6 +38538,10 @@ def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_s @cli_util.option('--is-free-tier', type=click.BOOL, help=u"""Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous AI Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled""") +@cli_util.option('--availability-domain', help=u"""The Autonomous Database Serverless instance's availability domain.""") +@cli_util.option('--time-scheduled-ad-update', type=custom_types.CLI_DATETIME, help=u"""The date and time when the Autonomous Database availability domain is to be updated.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--is-disable-ad-update-schedule', type=click.BOOL, help=u"""True, if you want to disable Autonomous Database availability domain scheduled update.""") +@cli_util.option('--is-schedule-ad-update-to-earliest', type=click.BOOL, help=u"""True, if you want to schedule Autonomous Database availability domain update to the earliest available time.""") @cli_util.option('--admin-password', help=u"""The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (\") or the username \"admin\", regardless of casing. It must be different from the last four passwords and it must not be a password used within the last 24 hours. This cannot be used in conjunction with with OCI vault secrets (secretId). @@ -38517,7 +38681,7 @@ def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_s @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'long-term-backup-schedule': {'module': 'database', 'class': 'LongTermBackUpScheduleDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'standby-whitelisted-ips': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'resource-pool-summary': {'module': 'database', 'class': 'ResourcePoolSummary'}, 'autonomous-database-maintenance-window': {'module': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowSummary'}, 'scheduled-operations': {'module': 'database', 'class': 'list[ScheduledOperationDetails]'}, 'db-tools-details': {'module': 'database', 'class': 'list[DatabaseTool]'}, 'vanity-url-details': {'module': 'database', 'class': 'VanityUrlDetails'}}, output_type={'module': 'database', 'class': 'AutonomousDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_database_oracle_managed_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): +def update_autonomous_database_oracle_managed_key_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_database_id, backup_retention_period_in_days, compute_model, in_memory_percentage, local_adg_auto_failover_max_data_loss_limit, cpu_core_count, long_term_backup_schedule, is_dev_tier, compute_count, ocpu_count, data_storage_size_in_tbs, data_storage_size_in_gbs, display_name, is_free_tier, availability_domain, time_scheduled_ad_update, is_disable_ad_update_schedule, is_schedule_ad_update_to_earliest, admin_password, db_name, freeform_tags, defined_tags, security_attributes, db_workload, license_model, byol_compute_count_limit, is_access_control_enabled, whitelisted_ips, are_primary_whitelisted_ips_used, standby_whitelisted_ips, is_auto_scaling_enabled, is_refreshable_clone, refreshable_mode, is_local_data_guard_enabled, is_data_guard_enabled, peer_db_id, db_version, open_mode, permission_level, subnet_id, private_endpoint_label, private_endpoint_ip, nsg_ids, auto_refresh_frequency_in_seconds, auto_refresh_point_lag_in_seconds, time_of_auto_refresh_start, customer_contacts, is_mtls_connection_required, resource_pool_leader_id, resource_pool_summary, autonomous_maintenance_schedule_type, autonomous_database_maintenance_window, time_maintenance_pause_until, is_backup_retention_locked, time_scheduled_db_version_upgrade, is_disable_db_version_upgrade_schedule, is_schedule_db_version_upgrade_to_earliest, scheduled_operations, is_auto_scaling_for_storage_enabled, database_edition, db_tools_details, vanity_url_details, secret_id, secret_version_number, is_disconnect_peer, local_adg_resource_pool_leader_id, if_match, opc_dry_run): if isinstance(autonomous_database_id, six.string_types) and len(autonomous_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-database-id cannot be whitespace or empty string') @@ -38575,6 +38739,18 @@ def update_autonomous_database_oracle_managed_key_details(ctx, from_json, force, if is_free_tier is not None: _details['isFreeTier'] = is_free_tier + if availability_domain is not None: + _details['availabilityDomain'] = availability_domain + + if time_scheduled_ad_update is not None: + _details['timeScheduledAdUpdate'] = time_scheduled_ad_update + + if is_disable_ad_update_schedule is not None: + _details['isDisableAdUpdateSchedule'] = is_disable_ad_update_schedule + + if is_schedule_ad_update_to_earliest is not None: + _details['isScheduleAdUpdateToEarliest'] = is_schedule_ad_update_to_earliest + if admin_password is not None: _details['adminPassword'] = admin_password diff --git a/services/ddfs/__init__.py b/services/ddfs/__init__.py new file mode 100644 index 000000000..c41dc808a --- /dev/null +++ b/services/ddfs/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260831 diff --git a/services/ddfs/src/__init__.py b/services/ddfs/src/__init__.py new file mode 100644 index 000000000..c41dc808a --- /dev/null +++ b/services/ddfs/src/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260831 diff --git a/services/ddfs/src/oci_cli_instance/__init__.py b/services/ddfs/src/oci_cli_instance/__init__.py new file mode 100644 index 000000000..c41dc808a --- /dev/null +++ b/services/ddfs/src/oci_cli_instance/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260831 diff --git a/services/ddfs/src/oci_cli_instance/generated/__init__.py b/services/ddfs/src/oci_cli_instance/generated/__init__.py new file mode 100644 index 000000000..c41dc808a --- /dev/null +++ b/services/ddfs/src/oci_cli_instance/generated/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260831 diff --git a/services/ddfs/src/oci_cli_instance/generated/client_mappings.py b/services/ddfs/src/oci_cli_instance/generated/client_mappings.py new file mode 100644 index 000000000..a3b4ea5cc --- /dev/null +++ b/services/ddfs/src/oci_cli_instance/generated/client_mappings.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260831 + +import oci +from oci_cli.cli_clients import CLIENT_MAP +from oci_cli.cli_clients import MODULE_TO_TYPE_MAPPINGS +from oci.ddfs import InstanceClient + +MODULE_TO_TYPE_MAPPINGS["ddfs"] = oci.ddfs.models.ddfs_type_mapping +if CLIENT_MAP.get("ddfs") is None: + CLIENT_MAP["ddfs"] = {} +CLIENT_MAP["ddfs"]["instance"] = InstanceClient diff --git a/services/ddfs/src/oci_cli_instance/generated/instance_cli.py b/services/ddfs/src/oci_cli_instance/generated/instance_cli.py new file mode 100644 index 000000000..4f0c1a0a5 --- /dev/null +++ b/services/ddfs/src/oci_cli_instance/generated/instance_cli.py @@ -0,0 +1,639 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260831 + +from __future__ import print_function +import click +import oci # noqa: F401 +import six # noqa: F401 +import sys # noqa: F401 +from oci_cli.cli_root import cli +from oci_cli import cli_constants # noqa: F401 +from oci_cli import cli_util +from oci_cli import json_skeleton_utils +from oci_cli import custom_types # noqa: F401 +from oci_cli.aliasing import CommandGroupWithAlias + + +@cli.command(cli_util.override('ddfs.ddfs_root_group.command_name', 'ddfs'), cls=CommandGroupWithAlias, help=cli_util.override('ddfs.ddfs_root_group.help', """Use the Device Data FHIR Service API to manage DDFS instances."""), short_help=cli_util.override('ddfs.ddfs_root_group.short_help', """Device Data FHIR Service API""")) +@cli_util.help_option_group +def ddfs_root_group(): + pass + + +@click.command(cli_util.override('ddfs.instance_group.command_name', 'instance'), cls=CommandGroupWithAlias, help="""A Device Data FHIR Service instance. + +To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies].""") +@cli_util.help_option_group +def instance_group(): + pass + + +@click.command(cli_util.override('ddfs.instance_collection_group.command_name', 'instance-collection'), cls=CommandGroupWithAlias, help="""Results of an instance search. Contains both InstanceSummary items and other information, such as metadata.""") +@cli_util.help_option_group +def instance_collection_group(): + pass + + +@click.command(cli_util.override('ddfs.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error encountered while performing an operation that is tracked by a work request.""") +@cli_util.help_option_group +def work_request_error_group(): + pass + + +@click.command(cli_util.override('ddfs.work_request_log_entry_group.command_name', 'work-request-log-entry'), cls=CommandGroupWithAlias, help="""A log message from performing an operation that is tracked by a work request.""") +@cli_util.help_option_group +def work_request_log_entry_group(): + pass + + +@click.command(cli_util.override('ddfs.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""An asynchronous work request. Work requests help you monitor long-running operations. When you start a long-running operation, the service creates a work request. A work request is an activity log that lets you track each step in the operation's progress. Each work request has an OCID that lets you interact with it programmatically and use it for automation.""") +@cli_util.help_option_group +def work_request_group(): + pass + + +ddfs_root_group.add_command(instance_group) +ddfs_root_group.add_command(instance_collection_group) +ddfs_root_group.add_command(work_request_error_group) +ddfs_root_group.add_command(work_request_log_entry_group) +ddfs_root_group.add_command(work_request_group) + + +@work_request_group.command(name=cli_util.override('ddfs.cancel_work_request.command_name', 'cancel'), help=u"""Cancels a work request. \n[Command Reference](cancelWorkRequest)""") +@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.confirm_delete_option +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def cancel_work_request(ctx, from_json, work_request_id, if_match): + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + result = client.cancel_work_request( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@instance_group.command(name=cli_util.override('ddfs.change_instance_compartment.command_name', 'change-compartment'), help=u"""Moves an Instance into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeInstanceCompartment)""") +@cli_util.option('--instance-id', required=True, help=u"""The [OCID] of the Instance.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to move the Instance to.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELLED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELLED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def change_instance_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, instance_id, compartment_id, if_match): + + if isinstance(instance_id, six.string_types) and len(instance_id.strip()) == 0: + raise click.UsageError('Parameter --instance-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + + client = cli_util.build_client('ddfs', 'instance', ctx) + result = client.change_instance_compartment( + instance_id=instance_id, + change_instance_compartment_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@instance_group.command(name=cli_util.override('ddfs.create_instance.command_name', 'create'), help=u"""Creates an Instance. \n[Command Reference](createInstance)""") +@cli_util.option('--idcs-url', required=True, help=u"""The Oracle Identity Cloud Service (IDCS) URL for the identity domain associated with the instance. Use the IDCS tenant URL from your identity domain configuration. + +Example: `https://idcs-1234567890.identity.oraclecloud.com`""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to create the Instance in.""") +@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. + +Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. + +Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELLED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELLED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ddfs', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ddfs', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ddfs', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ddfs', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'ddfs', 'class': 'Instance'}) +@cli_util.wrap_exceptions +def create_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, idcs_url, compartment_id, display_name, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['idcsUrl'] = idcs_url + _details['compartmentId'] = compartment_id + + if display_name is not None: + _details['displayName'] = display_name + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('ddfs', 'instance', ctx) + result = client.create_instance( + create_instance_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@instance_group.command(name=cli_util.override('ddfs.delete_instance.command_name', 'delete'), help=u"""Deletes an Instance. \n[Command Reference](deleteInstance)""") +@cli_util.option('--instance-id', required=True, help=u"""The [OCID] of the Instance.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.confirm_delete_option +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELLED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELLED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def delete_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, instance_id, if_match): + + if isinstance(instance_id, six.string_types) and len(instance_id.strip()) == 0: + raise click.UsageError('Parameter --instance-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + result = client.delete_instance( + instance_id=instance_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@instance_group.command(name=cli_util.override('ddfs.get_instance.command_name', 'get'), help=u"""Gets information about an Instance. \n[Command Reference](getInstance)""") +@cli_util.option('--instance-id', required=True, help=u"""The [OCID] of the Instance.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ddfs', 'class': 'Instance'}) +@cli_util.wrap_exceptions +def get_instance(ctx, from_json, instance_id): + + if isinstance(instance_id, six.string_types) and len(instance_id.strip()) == 0: + raise click.UsageError('Parameter --instance-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + result = client.get_instance( + instance_id=instance_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_group.command(name=cli_util.override('ddfs.get_work_request.command_name', 'get'), help=u"""Gets the details of a work request. \n[Command Reference](getWorkRequest)""") +@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ddfs', 'class': 'WorkRequest'}) +@cli_util.wrap_exceptions +def get_work_request(ctx, from_json, work_request_id): + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + result = client.get_work_request( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@instance_collection_group.command(name=cli_util.override('ddfs.list_instances.command_name', 'list-instances'), help=u"""Gets a list of Instances. \n[Command Reference](listInstances)""") +@cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment in which to list resources.""") +@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only resources that match the given lifecycle state. The state value is case-insensitive.""") +@cli_util.option('--display-name', help=u"""A filter to return only resources that match the given display name exactly.""") +@cli_util.option('--id', help=u"""The [OCID] of the Instance.""") +@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--page', help=u"""For list pagination. The value of the opc-next-page response header from the previous \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (`ASC`) or descending (`DESC`).""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. You can provide only one sort order. Default order for `timeCreated` is descending. Default order for `displayName` is ascending.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ddfs', 'class': 'InstanceCollection'}) +@cli_util.wrap_exceptions +def list_instances(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, display_name, id, limit, page, sort_order, sort_by): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + kwargs = {} + if compartment_id is not None: + kwargs['compartment_id'] = compartment_id + if lifecycle_state is not None: + kwargs['lifecycle_state'] = lifecycle_state + if display_name is not None: + kwargs['display_name'] = display_name + if id is not None: + kwargs['id'] = id + if limit is not None: + kwargs['limit'] = limit + if page is not None: + kwargs['page'] = page + if sort_order is not None: + kwargs['sort_order'] = sort_order + if sort_by is not None: + kwargs['sort_by'] = sort_by + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_instances, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_instances, + limit, + page_size, + **kwargs + ) + else: + result = client.list_instances( + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_error_group.command(name=cli_util.override('ddfs.list_work_request_errors.command_name', 'list'), help=u"""Lists the errors for a work request. \n[Command Reference](listWorkRequestErrors)""") +@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""") +@cli_util.option('--page', help=u"""For list pagination. The value of the opc-next-page response header from the previous \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for `timeCreated` is descending.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (`ASC`) or descending (`DESC`).""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ddfs', 'class': 'WorkRequestErrorCollection'}) +@cli_util.wrap_exceptions +def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + if page is not None: + kwargs['page'] = page + if limit is not None: + kwargs['limit'] = limit + if sort_by is not None: + kwargs['sort_by'] = sort_by + if sort_order is not None: + kwargs['sort_order'] = sort_order + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_work_request_errors, + work_request_id=work_request_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_work_request_errors, + limit, + page_size, + work_request_id=work_request_id, + **kwargs + ) + else: + result = client.list_work_request_errors( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_log_entry_group.command(name=cli_util.override('ddfs.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Lists the logs for a work request. \n[Command Reference](listWorkRequestLogs)""") +@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the asynchronous work request.""") +@cli_util.option('--page', help=u"""For list pagination. The value of the opc-next-page response header from the previous \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for `timeCreated` is descending.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (`ASC`) or descending (`DESC`).""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ddfs', 'class': 'WorkRequestLogEntryCollection'}) +@cli_util.wrap_exceptions +def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + if page is not None: + kwargs['page'] = page + if limit is not None: + kwargs['limit'] = limit + if sort_by is not None: + kwargs['sort_by'] = sort_by + if sort_order is not None: + kwargs['sort_order'] = sort_order + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_work_request_logs, + work_request_id=work_request_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_work_request_logs, + limit, + page_size, + work_request_id=work_request_id, + **kwargs + ) + else: + result = client.list_work_request_logs( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_group.command(name=cli_util.override('ddfs.list_work_requests.command_name', 'list'), help=u"""Lists the work requests in a compartment. \n[Command Reference](listWorkRequests)""") +@cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment in which to list resources.""") +@cli_util.option('--work-request-id', help=u"""The [OCID] of the asynchronous work request.""") +@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELLED"]), help=u"""A filter to return only work requests that match the given status.""") +@cli_util.option('--resource-id', help=u"""The [OCID] of the resource affected by the work request.""") +@cli_util.option('--page', help=u"""For list pagination. The value of the opc-next-page response header from the previous \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--limit', type=click.INT, help=u"""For list pagination. The maximum number of results per page, or items to return in a paginated \"List\" call. For important details about how pagination works, see [List Pagination].""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (`ASC`) or descending (`DESC`).""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for `timeAccepted` is descending.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'ddfs', 'class': 'WorkRequestSummaryCollection'}) +@cli_util.wrap_exceptions +def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, work_request_id, status, resource_id, page, limit, sort_order, sort_by): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + kwargs = {} + if compartment_id is not None: + kwargs['compartment_id'] = compartment_id + if work_request_id is not None: + kwargs['work_request_id'] = work_request_id + if status is not None: + kwargs['status'] = status + if resource_id is not None: + kwargs['resource_id'] = resource_id + if page is not None: + kwargs['page'] = page + if limit is not None: + kwargs['limit'] = limit + if sort_order is not None: + kwargs['sort_order'] = sort_order + if sort_by is not None: + kwargs['sort_by'] = sort_by + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('ddfs', 'instance', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_work_requests, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_work_requests, + limit, + page_size, + **kwargs + ) + else: + result = client.list_work_requests( + **kwargs + ) + cli_util.render_response(result, ctx) + + +@instance_group.command(name=cli_util.override('ddfs.update_instance.command_name', 'update'), help=u"""Updates an Instance. \n[Command Reference](updateInstance)""") +@cli_util.option('--instance-id', required=True, help=u"""The [OCID] of the Instance.""") +@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. + +Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. + +Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "NEEDS_ATTENTION", "FAILED", "SUCCEEDED", "CANCELLING", "CANCELLED"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state CANCELLED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'ddfs', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ddfs', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'ddfs', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'ddfs', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.wrap_exceptions +def update_instance(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, instance_id, display_name, freeform_tags, defined_tags, if_match): + + if isinstance(instance_id, six.string_types) and len(instance_id.strip()) == 0: + raise click.UsageError('Parameter --instance-id cannot be whitespace or empty string') + if not force: + if freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"): + ctx.abort() + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + if display_name is not None: + _details['displayName'] = display_name + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('ddfs', 'instance', ctx) + result = client.update_instance( + instance_id=instance_id, + update_instance_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) diff --git a/services/ddfs/src/oci_cli_instance/instance_cli_extended.py b/services/ddfs/src/oci_cli_instance/instance_cli_extended.py new file mode 100644 index 000000000..0ce352a5b --- /dev/null +++ b/services/ddfs/src/oci_cli_instance/instance_cli_extended.py @@ -0,0 +1,27 @@ +# coding: utf-8 +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. + +import click # noqa: F401 +import json # noqa: F401 +from services.ddfs.src.oci_cli_instance.generated import instance_cli +from oci_cli import cli_util # noqa: F401 +from oci_cli import custom_types # noqa: F401 +from oci_cli import json_skeleton_utils # noqa: F401 + + +# oci ddfs instance-collection list-instances -> oci ddfs instance-collection list +cli_util.rename_command(instance_cli, instance_cli.instance_collection_group, instance_cli.list_instances, "list") + + +# Move commands under 'oci ddfs instance-collection' -> 'oci ddfs instance' +instance_cli.ddfs_root_group.commands.pop(instance_cli.instance_collection_group.name) +instance_cli.instance_group.add_command(instance_cli.list_instances) + + +# oci ddfs work-request-log-entry list-work-request-logs -> oci ddfs work-request-log-entry list +cli_util.rename_command(instance_cli, instance_cli.work_request_log_entry_group, instance_cli.list_work_request_logs, "list") + + +# oci ddfs work-request-log-entry -> oci ddfs work-request-log +cli_util.rename_command(instance_cli, instance_cli.ddfs_root_group, instance_cli.work_request_log_entry_group, "work-request-log") diff --git a/services/ddfs/tests/__init__.py b/services/ddfs/tests/__init__.py new file mode 100644 index 000000000..c41dc808a --- /dev/null +++ b/services/ddfs/tests/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260831 diff --git a/services/ddfs/tests/util/generated/command_to_api.py b/services/ddfs/tests/util/generated/command_to_api.py new file mode 100644 index 000000000..7872471c1 --- /dev/null +++ b/services/ddfs/tests/util/generated/command_to_api.py @@ -0,0 +1,16 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. + +SDK_client_map = { + "ddfs.cancel_work_request": "oci.ddfs.InstanceClient.cancel_work_request", + "ddfs.change_instance_compartment": "oci.ddfs.InstanceClient.change_instance_compartment", + "ddfs.create_instance": "oci.ddfs.InstanceClient.create_instance", + "ddfs.delete_instance": "oci.ddfs.InstanceClient.delete_instance", + "ddfs.get_instance": "oci.ddfs.InstanceClient.get_instance", + "ddfs.get_work_request": "oci.ddfs.InstanceClient.get_work_request", + "ddfs.list_instances": "oci.ddfs.InstanceClient.list_instances", + "ddfs.list_work_request_errors": "oci.ddfs.InstanceClient.list_work_request_errors", + "ddfs.list_work_request_logs": "oci.ddfs.InstanceClient.list_work_request_logs", + "ddfs.list_work_requests": "oci.ddfs.InstanceClient.list_work_requests", + "ddfs.update_instance": "oci.ddfs.InstanceClient.update_instance", +} diff --git a/services/distributed_database_v26/__init__.py b/services/distributed_database_v26/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/__init__.py b/services/distributed_database_v26/src/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/client_mappings.py b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/client_mappings.py new file mode 100644 index 000000000..3a9b10432 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/client_mappings.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +import oci +from oci_cli.cli_clients import CLIENT_MAP +from oci_cli.cli_clients import MODULE_TO_TYPE_MAPPINGS +from oci.distributed_database_v26 import DistributedAutonomousDbServiceClient + +MODULE_TO_TYPE_MAPPINGS["distributed_database_v26"] = oci.distributed_database_v26.models.distributed_database_v26_type_mapping +if CLIENT_MAP.get("distributed_database_v26") is None: + CLIENT_MAP["distributed_database_v26"] = {} +CLIENT_MAP["distributed_database_v26"]["distributed_autonomous_db_service"] = DistributedAutonomousDbServiceClient diff --git a/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/distributedautonomousdbservice_cli.py b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/distributedautonomousdbservice_cli.py new file mode 100644 index 000000000..b7a38fd49 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_autonomous_db_service/generated/distributedautonomousdbservice_cli.py @@ -0,0 +1,1489 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +from __future__ import print_function +import click +import oci # noqa: F401 +import six # noqa: F401 +import sys # noqa: F401 +from oci_cli import cli_constants # noqa: F401 +from oci_cli import cli_util +from oci_cli import json_skeleton_utils +from oci_cli import custom_types # noqa: F401 +from oci_cli.aliasing import CommandGroupWithAlias +from services.distributed_database_v26.src.oci_cli_distributed_database_v26.generated import distributed_database_v26_service_cli + + +@click.command(cli_util.override('distributed_autonomous_db_service.distributed_autonomous_db_service_root_group.command_name', 'distributed-autonomous-db-service'), cls=CommandGroupWithAlias, help=cli_util.override('distributed_autonomous_db_service.distributed_autonomous_db_service_root_group.help', """Use the Globally Distributed Database service APIs to create and manage the Globally distributed databases."""), short_help=cli_util.override('distributed_autonomous_db_service.distributed_autonomous_db_service_root_group.short_help', """Globally Distributed Database""")) +@cli_util.help_option_group +def distributed_autonomous_db_service_root_group(): + pass + + +@click.command(cli_util.override('distributed_autonomous_db_service.distributed_autonomous_database_collection_group.command_name', 'distributed-autonomous-database-collection'), cls=CommandGroupWithAlias, help="""Collection of Globally distributed autonomous databases.""") +@cli_util.help_option_group +def distributed_autonomous_database_collection_group(): + pass + + +@click.command(cli_util.override('distributed_autonomous_db_service.distributed_autonomous_database_group.command_name', 'distributed-autonomous-database'), cls=CommandGroupWithAlias, help="""Globally distributed autonomous database.""") +@cli_util.help_option_group +def distributed_autonomous_database_group(): + pass + + +@click.command(cli_util.override('distributed_autonomous_db_service.distributed_database_group.command_name', 'distributed-database'), cls=CommandGroupWithAlias, help="""Globally distributed database.""") +@cli_util.help_option_group +def distributed_database_group(): + pass + + +distributed_database_v26_service_cli.distributed_database_v26_service_group.add_command(distributed_autonomous_db_service_root_group) +distributed_autonomous_db_service_root_group.add_command(distributed_autonomous_database_collection_group) +distributed_autonomous_db_service_root_group.add_command(distributed_autonomous_database_group) +distributed_autonomous_db_service_root_group.add_command(distributed_database_group) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.add_distributed_autonomous_database_gds_control_node.command_name', 'add'), help=u"""Add new Global database services control(GDS CTL) node for the Globally distributed autonomous database. \n[Command Reference](addDistributedAutonomousDatabaseGdsControlNode)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--public-ssh-key', required=True, help=u"""The public sshKey for Global database services control(GDS CTL) node.""") +@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet on which the Global database services control(GDS CTL) node should be created.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def add_distributed_autonomous_database_gds_control_node(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, public_ssh_key, subnet_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['publicSshKey'] = public_ssh_key + + if subnet_id is not None: + _details['subnetId'] = subnet_id + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.add_distributed_autonomous_database_gds_control_node( + distributed_autonomous_database_id=distributed_autonomous_database_id, + add_distributed_autonomous_database_gds_control_node_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.change_distributed_autonomous_database_compartment.command_name', 'change-compartment'), help=u"""Move the Globally distributed autonomous database and its dependent resources to the specified compartment. \n[Command Reference](changeDistributedAutonomousDatabaseCompartment)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to move the resource to.""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def change_distributed_autonomous_database_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.change_distributed_autonomous_database_compartment( + distributed_autonomous_database_id=distributed_autonomous_database_id, + change_distributed_autonomous_database_compartment_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.change_distributed_autonomous_db_backup_config.command_name', 'change-distributed-autonomous-db-backup-config'), help=u"""Change the DbBackupConfig for the Globally distributed autonomous database. \n[Command Reference](changeDistributedAutonomousDbBackupConfig)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--db-backup-config', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDbBackupConfig'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDbBackupConfig'}}) +@cli_util.wrap_exceptions +def change_distributed_autonomous_db_backup_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, db_backup_config, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['dbBackupConfig'] = cli_util.parse_json_parameter("db_backup_config", db_backup_config) + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.change_distributed_autonomous_db_backup_config( + distributed_autonomous_database_id=distributed_autonomous_database_id, + change_distributed_autonomous_db_backup_config_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.configure_distributed_autonomous_database_auto_resource_management.command_name', 'configure-distributed-autonomous-database-auto-resource-management'), help=u"""Configure autoResourceManagement options for the Globally distributed autonomous database. \n[Command Reference](configureDistributedAutonomousDatabaseAutoResourceManagement)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--is-enabled', required=True, type=click.BOOL, help=u"""Flag indicating if autoResourceManagement is enabled or disabled.""") +@cli_util.option('--cool-off-period-in-minutes', type=click.INT, help=u"""Time period to wait for the database to get stable after autoResourceManagement event.""") +@cli_util.option('--max-move-ru-attempts', type=click.INT, help=u"""Maximum number of move replication unit attempts allowed within the configured period per database.""") +@cli_util.option('--max-move-ru-unit', type=custom_types.CliCaseInsensitiveChoice(["HOUR", "DAY"]), help=u"""Time unit applicable to maxMoveRuAttempts.""") +@cli_util.option('--mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "RECOMMENDATION"]), help=u"""Mode of autoResourceManagement execution.""") +@cli_util.option('--action-type', type=custom_types.CliCaseInsensitiveChoice(["MOVE"]), help=u"""The action that will be taken when autoResourceManagement is triggered.""") +@cli_util.option('--notification-topic-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of notification topic ids [OCIDs] to receive autoResourceManagement events.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--stream-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of stream ids [OCIDs] that receive shard-related telemetry.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@json_skeleton_utils.get_cli_json_input_option({'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'stream-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'stream-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDatabaseAutoResourceManagementDetails'}) +@cli_util.wrap_exceptions +def configure_distributed_autonomous_database_auto_resource_management(ctx, from_json, distributed_autonomous_database_id, is_enabled, cool_off_period_in_minutes, max_move_ru_attempts, max_move_ru_unit, mode, action_type, notification_topic_ids, stream_ids, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['isEnabled'] = is_enabled + + if cool_off_period_in_minutes is not None: + _details['coolOffPeriodInMinutes'] = cool_off_period_in_minutes + + if max_move_ru_attempts is not None: + _details['maxMoveRuAttempts'] = max_move_ru_attempts + + if max_move_ru_unit is not None: + _details['maxMoveRuUnit'] = max_move_ru_unit + + if mode is not None: + _details['mode'] = mode + + if action_type is not None: + _details['actionType'] = action_type + + if notification_topic_ids is not None: + _details['notificationTopicIds'] = cli_util.parse_json_parameter("notification_topic_ids", notification_topic_ids) + + if stream_ids is not None: + _details['streamIds'] = cli_util.parse_json_parameter("stream_ids", stream_ids) + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.configure_distributed_autonomous_database_auto_resource_management( + distributed_autonomous_database_id=distributed_autonomous_database_id, + configure_distributed_autonomous_database_auto_resource_management_details=_details, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.configure_distributed_autonomous_database_gsm_wallet.command_name', 'configure-distributed-autonomous-database-gsm-wallet'), help=u"""Configure wallets on Global Service Manager(GSM) instances for a Globally distributed autonomous database. \n[Command Reference](configureDistributedAutonomousDatabaseGsmWallet)""") +@cli_util.option('--certificate-id', required=True, help=u"""The [OCID] of the cluster certificate.""") +@cli_util.option('--ca-bundle-id', required=True, help=u"""The [OCID] of the ca bundle id.""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def configure_distributed_autonomous_database_gsm_wallet(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, certificate_id, ca_bundle_id, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['certificateId'] = certificate_id + _details['caBundleId'] = ca_bundle_id + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.configure_distributed_autonomous_database_gsm_wallet( + distributed_autonomous_database_id=distributed_autonomous_database_id, + configure_distributed_autonomous_database_gsm_wallet_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.configure_distributed_autonomous_database_gsms.command_name', 'configure-distributed-autonomous-database-gsms'), help=u"""Configure new Global Service Manager(GSM aka shard manager) instances for the Globally distributed autonomous database. \n[Command Reference](configureDistributedAutonomousDatabaseGsms)""") +@cli_util.option('--old-gsm-names', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Names of old global service manager(GSM) instances corresponding to which new GSM instances need to be configured.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--is-latest-gsm-image', required=True, type=click.BOOL, help=u"""Flag to indicate if new global service manager(GSM) instances shall use latest image or re-use image used by existing GSM instances.""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'old-gsm-names': {'module': 'distributed_database_v26', 'class': 'list[string]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'old-gsm-names': {'module': 'distributed_database_v26', 'class': 'list[string]'}}) +@cli_util.wrap_exceptions +def configure_distributed_autonomous_database_gsms(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, old_gsm_names, is_latest_gsm_image, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['oldGsmNames'] = cli_util.parse_json_parameter("old_gsm_names", old_gsm_names) + _details['isLatestGsmImage'] = is_latest_gsm_image + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.configure_distributed_autonomous_database_gsms( + distributed_autonomous_database_id=distributed_autonomous_database_id, + configure_distributed_autonomous_database_gsms_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.configure_distributed_autonomous_database_sharding.command_name', 'configure-distributed-autonomous-database-sharding'), help=u"""Once all components of Globally distributed autonomous database are provisioned, this api shall be invoked to configure sharding on the Globally distributed autonomous database. Note that this 'ConfigureSharding' API also needs to be invoked after successfully adding a new shard to the Globally distributed autonomous database using PATCH api. If this API is not invoked after successfully adding a new shard, then that new shard will not be a participant in sharding topology of the Globally distributed autonomous database. \n[Command Reference](configureDistributedAutonomousDatabaseSharding)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--is-rebalance-required', type=click.BOOL, help=u"""The flag to indicate whether chunks need to be re-balanced. This flag is not applicable for USER-defined sharding type.""") +@cli_util.option('--certificate-id', help=u"""The ID of the cluster certificate.""") +@cli_util.option('--ca-bundle-id', help=u"""The ID of the Ca Bundle.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def configure_distributed_autonomous_database_sharding(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, is_rebalance_required, certificate_id, ca_bundle_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if is_rebalance_required is not None: + kwargs['is_rebalance_required'] = is_rebalance_required + if certificate_id is not None: + kwargs['certificate_id'] = certificate_id + if ca_bundle_id is not None: + kwargs['ca_bundle_id'] = ca_bundle_id + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.configure_distributed_autonomous_database_sharding( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.create_distributed_autonomous_database.command_name', 'create'), help=u"""Creates a Globally distributed autonomous database. \n[Command Reference](createDistributedAutonomousDatabase)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the Globally distributed autonomous database compartment.""") +@cli_util.option('--display-name', required=True, help=u"""The display name of the Globally distributed autonomous database.""") +@cli_util.option('--database-version', required=True, help=u"""Oracle Database version for the shards and catalog used in Globally distributed autonomous database.""") +@cli_util.option('--prefix', required=True, help=u"""Unique name prefix for the Globally distributed autonomous databases. Only alpha-numeric values are allowed. First character has to be a letter followed by any combination of letter and number.""") +@cli_util.option('--private-endpoint-ids', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of [OCID] of the private endpoint associated with Globally distributed autonomous database.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--db-workload-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["OLTP", "DW"]), help=u"""Possible workload types. Currently only OLTP workload type is supported.""") +@cli_util.option('--character-set', required=True, help=u"""The character set for the database.""") +@cli_util.option('--ncharacter-set', required=True, help=u"""The national character set for the database.""") +@cli_util.option('--listener-port', required=True, type=click.INT, help=u"""The listener port number for the Globally distributed autonomous database. The listener port number has to be unique for a customer tenancy across all distributed autonomous databases. Same port number should not be re-used for any other distributed autonomous database.""") +@cli_util.option('--ons-port-local', required=True, type=click.INT, help=u"""Ons local port number for Globally distributed autonomous database. The onsPortLocal has to be unique for a customer tenancy across all distributed autonomous databases. Same port number should not be re-used for any other distributed autonomous database.""") +@cli_util.option('--ons-port-remote', required=True, type=click.INT, help=u"""Ons remote port number for Globally distributed autonomous database. The onsPortRemote has to be unique for a customer tenancy across all distributed autonomous databases. Same port number should not be re-used for any other distributed autonomous database.""") +@cli_util.option('--catalog-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of catalog for the Globally distributed autonomous database.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--notification-topic-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of [OCID] for the notification topics associated with the globally distributed autonomous database.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--listener-port-tls', type=click.INT, help=u"""The TLS listener port number for Globally distributed autonomous database. The TLS listener port number has to be unique for a customer tenancy across all distributed autonomous databases. Same port number should not be re-used for any other distributed autonomous database. The listenerPortTls is mandatory for dedicated infrastructure based distributed autonomous databases.""") +@cli_util.option('--system-chunk-count', type=click.INT, help=u"""Count of chunks associated with system raft clusters or system data guard databases.""") +@cli_util.option('--system-raft-replication-unit-count', type=click.INT, help=u"""Number of replication units associated with system raft clusters.""") +@cli_util.option('--composite-raft-shard-spaces', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of composite raft shards. + +This option is a JSON list with items of type CreateAutonomousCompositeRaftShardSpaceDetails. For documentation on CreateAutonomousCompositeRaftShardSpaceDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributedautonomousdbservice/20260101/datatypes/CreateAutonomousCompositeRaftShardSpaceDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--composite-data-guard-shard-spaces', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of composite data guard shard spaces. + +This option is a JSON list with items of type CreateAutonomousCompositeDataGuardShardSpaceDetails. For documentation on CreateAutonomousCompositeDataGuardShardSpaceDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributedautonomousdbservice/20260101/datatypes/CreateAutonomousCompositeDataGuardShardSpaceDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--system-raft-clusters', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of system raft clusters. + +This option is a JSON list with items of type CreateAutonomousSystemRaftClusterDetails. For documentation on CreateAutonomousSystemRaftClusterDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributedautonomousdbservice/20260101/datatypes/CreateAutonomousSystemRaftClusterDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--system-data-guard-databases', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--user-shard-spaces', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of user defined shard spaces. + +This option is a JSON list with items of type CreateAutonomousUserShardSpaceDetails. For documentation on CreateAutonomousUserShardSpaceDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributedautonomousdbservice/20260101/datatypes/CreateAutonomousUserShardSpaceDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--db-backup-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--vcn-nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of network security group (NSG) details to be associated with the distributed autonomous database. + +This option is a JSON list with items of type VcnNsgIdsDetails. For documentation on VcnNsgIdsDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributedautonomousdbservice/20260101/datatypes/VcnNsgIdsDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'private-endpoint-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'composite-raft-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousCompositeRaftShardSpaceDetails]'}, 'composite-data-guard-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousCompositeDataGuardShardSpaceDetails]'}, 'system-raft-clusters': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousSystemRaftClusterDetails]'}, 'system-data-guard-databases': {'module': 'distributed_database_v26', 'class': 'CreateAutonomousSystemDataGuardDatabaseDetails'}, 'user-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousUserShardSpaceDetails]'}, 'catalog-details': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousCatalogDetails]'}, 'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDbBackupConfig'}, 'vcn-nsg-ids': {'module': 'distributed_database_v26', 'class': 'list[VcnNsgIdsDetails]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'private-endpoint-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'composite-raft-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousCompositeRaftShardSpaceDetails]'}, 'composite-data-guard-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousCompositeDataGuardShardSpaceDetails]'}, 'system-raft-clusters': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousSystemRaftClusterDetails]'}, 'system-data-guard-databases': {'module': 'distributed_database_v26', 'class': 'CreateAutonomousSystemDataGuardDatabaseDetails'}, 'user-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousUserShardSpaceDetails]'}, 'catalog-details': {'module': 'distributed_database_v26', 'class': 'list[CreateAutonomousCatalogDetails]'}, 'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDbBackupConfig'}, 'vcn-nsg-ids': {'module': 'distributed_database_v26', 'class': 'list[VcnNsgIdsDetails]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDatabase'}) +@cli_util.wrap_exceptions +def create_distributed_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, database_version, prefix, private_endpoint_ids, db_workload_type, character_set, ncharacter_set, listener_port, ons_port_local, ons_port_remote, catalog_details, notification_topic_ids, listener_port_tls, system_chunk_count, system_raft_replication_unit_count, composite_raft_shard_spaces, composite_data_guard_shard_spaces, system_raft_clusters, system_data_guard_databases, user_shard_spaces, db_backup_config, vcn_nsg_ids, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + _details['displayName'] = display_name + _details['databaseVersion'] = database_version + _details['prefix'] = prefix + _details['privateEndpointIds'] = cli_util.parse_json_parameter("private_endpoint_ids", private_endpoint_ids) + _details['dbWorkloadType'] = db_workload_type + _details['characterSet'] = character_set + _details['ncharacterSet'] = ncharacter_set + _details['listenerPort'] = listener_port + _details['onsPortLocal'] = ons_port_local + _details['onsPortRemote'] = ons_port_remote + _details['catalogDetails'] = cli_util.parse_json_parameter("catalog_details", catalog_details) + + if notification_topic_ids is not None: + _details['notificationTopicIds'] = cli_util.parse_json_parameter("notification_topic_ids", notification_topic_ids) + + if listener_port_tls is not None: + _details['listenerPortTls'] = listener_port_tls + + if system_chunk_count is not None: + _details['systemChunkCount'] = system_chunk_count + + if system_raft_replication_unit_count is not None: + _details['systemRaftReplicationUnitCount'] = system_raft_replication_unit_count + + if composite_raft_shard_spaces is not None: + _details['compositeRaftShardSpaces'] = cli_util.parse_json_parameter("composite_raft_shard_spaces", composite_raft_shard_spaces) + + if composite_data_guard_shard_spaces is not None: + _details['compositeDataGuardShardSpaces'] = cli_util.parse_json_parameter("composite_data_guard_shard_spaces", composite_data_guard_shard_spaces) + + if system_raft_clusters is not None: + _details['systemRaftClusters'] = cli_util.parse_json_parameter("system_raft_clusters", system_raft_clusters) + + if system_data_guard_databases is not None: + _details['systemDataGuardDatabases'] = cli_util.parse_json_parameter("system_data_guard_databases", system_data_guard_databases) + + if user_shard_spaces is not None: + _details['userShardSpaces'] = cli_util.parse_json_parameter("user_shard_spaces", user_shard_spaces) + + if db_backup_config is not None: + _details['dbBackupConfig'] = cli_util.parse_json_parameter("db_backup_config", db_backup_config) + + if vcn_nsg_ids is not None: + _details['vcnNsgIds'] = cli_util.parse_json_parameter("vcn_nsg_ids", vcn_nsg_ids) + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.create_distributed_autonomous_database( + create_distributed_autonomous_database_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.delete_distributed_autonomous_database.command_name', 'delete'), help=u"""Terminate the given Globally distributed autonomous databases. \n[Command Reference](deleteDistributedAutonomousDatabase)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.confirm_delete_option +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def delete_distributed_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.delete_distributed_autonomous_database( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.generate_distributed_autonomous_database_wallet.command_name', 'generate-distributed-autonomous-database-wallet'), help=u"""Generate the wallet associated with Globally distributed autonomous database. \n[Command Reference](generateDistributedAutonomousDatabaseWallet)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--password', required=True, help=u"""The password to encrypt the keys inside the wallet. The password must be at least 8 characters long and must include at least 1 letter and either 1 numeric character or 1 special character.""") +@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def generate_distributed_autonomous_database_wallet(ctx, from_json, file, distributed_autonomous_database_id, password, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['password'] = password + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.generate_distributed_autonomous_database_wallet( + distributed_autonomous_database_id=distributed_autonomous_database_id, + generate_distributed_autonomous_database_wallet_details=_details, + **kwargs + ) + + # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output + # Also we need a non-zero Content-Length in order to display a meaningful progress bar + bar = None + if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers: + content_length = int(result.headers['Content-Length']) + if content_length > 0: + bar = click.progressbar(length=content_length, label='Downloading file') + + try: + if bar: + bar.__enter__() + + # TODO: Make the download size a configurable option + # use decode_content=True to automatically unzip service responses (this should be overridden for object storage) + for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True): + if bar: + bar.update(len(chunk)) + file.write(chunk) + finally: + if bar: + bar.render_finish() + file.close() + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.get_distributed_autonomous_database.command_name', 'get'), help=u"""Gets the details of the Globally distributed autonomous database identified by given id. \n[Command Reference](getDistributedAutonomousDatabase)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--metadata', help=u"""Comma-separated argument names for which metadata should be retrieved.""") +@cli_util.option('--if-none-match', help=u"""For conditional requests. In the GET call for a resource, set the `If-None-Match` header to the value of the ETag from a previous GET (or POST or PUT) response for that resource. The server will return with either a 304 Not Modified response if the resource has not changed, or a 200 OK response with the updated representation.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDatabase'}) +@cli_util.wrap_exceptions +def get_distributed_autonomous_database(ctx, from_json, distributed_autonomous_database_id, metadata, if_none_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if metadata is not None: + kwargs['metadata'] = metadata + if if_none_match is not None: + kwargs['if_none_match'] = if_none_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.get_distributed_autonomous_database( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_autonomous_db_service.get_distributed_autonomous_database_raft_metric.command_name', 'get-distributed-autonomous-database-raft-metric'), help=u"""Operation to retrieve RAFT metrics for the Globally distributed autonomous database. If the Globally distributed autonomous database is not RAFT based then empty response is returned from the API. \n[Command Reference](getDistributedAutonomousDatabaseRaftMetric)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDatabaseRaftMetric'}) +@cli_util.wrap_exceptions +def get_distributed_autonomous_database_raft_metric(ctx, from_json, distributed_autonomous_database_id): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.get_distributed_autonomous_database_raft_metric( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_autonomous_db_service.get_distributed_autonomous_database_ru_change_log.command_name', 'get-distributed-autonomous-database-ru-change-log'), help=u"""Operation to retrieve move RU invocation history and status for the Globally distributed autonomous database. Results are ordered by created timestamp in descending order. \n[Command Reference](getDistributedAutonomousDatabaseRuChangeLog)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--source-shard-name', help=u"""The source shard name to filter RU change log entries.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDatabaseRuChangeLog'}) +@cli_util.wrap_exceptions +def get_distributed_autonomous_database_ru_change_log(ctx, from_json, distributed_autonomous_database_id, source_shard_name): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if source_shard_name is not None: + kwargs['source_shard_name'] = source_shard_name + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.get_distributed_autonomous_database_ru_change_log( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_collection_group.command(name=cli_util.override('distributed_autonomous_db_service.list_distributed_autonomous_databases.command_name', 'list-distributed-autonomous-databases'), help=u"""List of Globally distributed autonomous databases. \n[Command Reference](listDistributedAutonomousDatabases)""") +@cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""") +@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""When set to true, returns resources in the specified compartment and in all of its child compartments recursively. Defaults to false.""") +@cli_util.option('--private-endpoint-id', help=u"""A filter to return only resources that are associated with the given privateEndpointId.""") +@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "FAILED", "NEEDS_ATTENTION", "INACTIVE", "DELETING", "DELETED", "UPDATING", "CREATING"]), help=u"""A filter to return only resources whose lifecycleState matches the specified value.""") +@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") +@cli_util.option('--page', help=u"""A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "timeUpdated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""") +@cli_util.option('--is-auto-resource-management-enabled', type=click.BOOL, help=u"""A filter to return only resources where autoResourceManagement is enabled when set to `true`, or disabled when set to `false`. If omitted, no autoResourceManagement-based filtering is applied.""") +@cli_util.option('--display-name', help=u"""A filter to return only Globally distributed autonomous databases that match the entire name given. The match is not case sensitive.""") +@cli_util.option('--db-deployment-type', help=u"""A filter to return only resources whose dbDeploymentType matches the specified value.""") +@cli_util.option('--metadata', help=u"""Comma-separated argument names for which metadata should be retrieved.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDatabaseCollection'}) +@cli_util.wrap_exceptions +def list_distributed_autonomous_databases(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, private_endpoint_id, lifecycle_state, limit, page, sort_order, sort_by, is_auto_resource_management_enabled, display_name, db_deployment_type, metadata): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + kwargs = {} + if compartment_id_in_subtree is not None: + kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree + if private_endpoint_id is not None: + kwargs['private_endpoint_id'] = private_endpoint_id + if lifecycle_state is not None: + kwargs['lifecycle_state'] = lifecycle_state + if limit is not None: + kwargs['limit'] = limit + if page is not None: + kwargs['page'] = page + if sort_order is not None: + kwargs['sort_order'] = sort_order + if sort_by is not None: + kwargs['sort_by'] = sort_by + if is_auto_resource_management_enabled is not None: + kwargs['is_auto_resource_management_enabled'] = is_auto_resource_management_enabled + if display_name is not None: + kwargs['display_name'] = display_name + if db_deployment_type is not None: + kwargs['db_deployment_type'] = db_deployment_type + if metadata is not None: + kwargs['metadata'] = metadata + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_distributed_autonomous_databases, + compartment_id=compartment_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_distributed_autonomous_databases, + limit, + page_size, + compartment_id=compartment_id, + **kwargs + ) + else: + result = client.list_distributed_autonomous_databases( + compartment_id=compartment_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.move_distributed_autonomous_database_replication_unit.command_name', 'move-distributed-autonomous-database-replication-unit'), help=u"""Move the replication units for RAFT based globally distributed autonomous database from source shard to destination shard. \n[Command Reference](moveDistributedAutonomousDatabaseReplicationUnit)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--source-shard-name', required=True, help=u"""The name of the source shard from which to move the chunks out to other shards.""") +@cli_util.option('--destination-shard-name', help=u"""The name of the destination shard to which the chunks moved out from source shard should be relocate to.""") +@cli_util.option('--replication-units', type=custom_types.CLI_COMPLEX_TYPE, help=u"""For RAFT databases please provide replication unit numbers to be moved from source shard to destination shard.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'replication-units': {'module': 'distributed_database_v26', 'class': 'list[integer]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'replication-units': {'module': 'distributed_database_v26', 'class': 'list[integer]'}}) +@cli_util.wrap_exceptions +def move_distributed_autonomous_database_replication_unit(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, source_shard_name, destination_shard_name, replication_units, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['sourceShardName'] = source_shard_name + + if destination_shard_name is not None: + _details['destinationShardName'] = destination_shard_name + + if replication_units is not None: + _details['replicationUnits'] = cli_util.parse_json_parameter("replication_units", replication_units) + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.move_distributed_autonomous_database_replication_unit( + distributed_autonomous_database_id=distributed_autonomous_database_id, + move_distributed_autonomous_database_replication_unit_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.patch_distributed_autonomous_database.command_name', 'patch'), help=u"""Patch operation to add, remove or update shards to the Globally distributed autonomous database topology. In single patch operation, multiple shards can be either added, or removed or updated. Combination of inserts, update and remove in single operation is not allowed. \n[Command Reference](patchDistributedAutonomousDatabase)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of patch instructions. + +This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributedautonomousdbservice/20260101/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'distributed_database_v26', 'class': 'list[PatchInstruction]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'distributed_database_v26', 'class': 'list[PatchInstruction]'}}) +@cli_util.wrap_exceptions +def patch_distributed_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, items, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + if items is not None: + _details['items'] = cli_util.parse_json_parameter("items", items) + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.patch_distributed_autonomous_database( + distributed_autonomous_database_id=distributed_autonomous_database_id, + patch_distributed_autonomous_database_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.recreate_failed_distributed_autonomous_database_resource.command_name', 'recreate-failed-distributed-autonomous-database-resource'), help=u"""Recreate the failed resource for the Globally Distributed Autonomous Database. \n[Command Reference](recreateFailedDistributedAutonomousDatabaseResource)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--resource-name', required=True, help=u"""Specify the name of the shard, catalog, or GSM.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def recreate_failed_distributed_autonomous_database_resource(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, resource_name, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.recreate_failed_distributed_autonomous_database_resource( + distributed_autonomous_database_id=distributed_autonomous_database_id, + resource_name=resource_name, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.rotate_distributed_autonomous_database_passwords.command_name', 'rotate-distributed-autonomous-database-passwords'), help=u"""Rotate the gsmuser and gsmcatuser passwords for shards and catalog of the Globally distributed autonomous database. This operation will also remove GdsCtlNodes if present. \n[Command Reference](rotateDistributedAutonomousDatabasePasswords)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--database-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of shard or catalog password rotation details.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'database-details': {'module': 'distributed_database_v26', 'class': 'list[RotateDistributedAutonomousDatabaseDetails]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'database-details': {'module': 'distributed_database_v26', 'class': 'list[RotateDistributedAutonomousDatabaseDetails]'}}) +@cli_util.wrap_exceptions +def rotate_distributed_autonomous_database_passwords(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, database_details, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details) + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.rotate_distributed_autonomous_database_passwords( + distributed_autonomous_database_id=distributed_autonomous_database_id, + rotate_distributed_autonomous_database_passwords_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.scale_distributed_autonomous_database_gsms.command_name', 'scale-distributed-autonomous-database-gsms'), help=u"""Scale global service manager(GSM aka shard director) instances for the Globally distributed autonomous database. \n[Command Reference](scaleDistributedAutonomousDatabaseGsms)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def scale_distributed_autonomous_database_gsms(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.scale_distributed_autonomous_database_gsms( + distributed_autonomous_database_id=distributed_autonomous_database_id, + scale_distributed_autonomous_database_gsms_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.start_distributed_autonomous_database.command_name', 'start'), help=u"""Start the shards, catalog, GSMs and GDSCTL instances of Globally distributed autonomous database. \n[Command Reference](startDistributedAutonomousDatabase)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def start_distributed_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.start_distributed_autonomous_database( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.stop_distributed_autonomous_database.command_name', 'stop'), help=u"""Stop the shards, catalog, GSMs and GDSCTL instances for the Globally distributed autonomous database. \n[Command Reference](stopDistributedAutonomousDatabase)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def stop_distributed_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.stop_distributed_autonomous_database( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.update_distributed_autonomous_database.command_name', 'update'), help=u"""Updates the configuration of the Globally distributed autonomous database. \n[Command Reference](updateDistributedAutonomousDatabase)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--display-name', help=u"""Display name of the Globally distributed autonomous database.""") +@cli_util.option('--notification-topic-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of [OCID] for the notification topics associated with the globally distributed autonomous database. Pass an empty list (`[]`) to remove existing notification topics (set `notificationTopicIds` to empty).""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "FAILED", "NEEDS_ATTENTION", "INACTIVE", "DELETING", "DELETED", "UPDATING", "CREATING"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACTIVE --wait-for-state CREATING would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedAutonomousDatabase'}) +@cli_util.wrap_exceptions +def update_distributed_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, display_name, notification_topic_ids, freeform_tags, defined_tags, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + if not force: + if notification_topic_ids or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to notification-topic-ids and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"): + ctx.abort() + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + if display_name is not None: + _details['displayName'] = display_name + + if notification_topic_ids is not None: + _details['notificationTopicIds'] = cli_util.parse_json_parameter("notification_topic_ids", notification_topic_ids) + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.update_distributed_autonomous_database( + distributed_autonomous_database_id=distributed_autonomous_database_id, + update_distributed_autonomous_database_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_distributed_autonomous_database') and callable(getattr(client, 'get_distributed_autonomous_database')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + + click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_distributed_autonomous_database(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.validate_distributed_autonomous_database_ca_bundle.command_name', 'validate-distributed-autonomous-database-ca-bundle'), help=u"""Validate the CA Bundles consistency of the globally distributed autonomous database. \n[Command Reference](validateDistributedAutonomousDatabaseCaBundle)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def validate_distributed_autonomous_database_ca_bundle(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.validate_distributed_autonomous_database_ca_bundle( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_autonomous_database_group.command(name=cli_util.override('distributed_autonomous_db_service.validate_distributed_autonomous_database_network.command_name', 'validate-distributed-autonomous-database-network'), help=u"""Validate the network connectivity between components of the globally distributed autonomous database. \n[Command Reference](validateDistributedAutonomousDatabaseNetwork)""") +@cli_util.option('--distributed-autonomous-database-id', required=True, help=u"""Globally distributed autonomous database identifier.""") +@cli_util.option('--is-surrogate', type=click.BOOL, help=u"""Determines the surrogates check. Default is true.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def validate_distributed_autonomous_database_network(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_autonomous_database_id, is_surrogate, if_match): + + if isinstance(distributed_autonomous_database_id, six.string_types) and len(distributed_autonomous_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-autonomous-database-id cannot be whitespace or empty string') + + kwargs = {} + if is_surrogate is not None: + kwargs['is_surrogate'] = is_surrogate + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_autonomous_db_service', ctx) + result = client.validate_distributed_autonomous_database_network( + distributed_autonomous_database_id=distributed_autonomous_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) diff --git a/services/distributed_database_v26/src/oci_cli_distributed_database_v26/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_database_v26/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_database_v26/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/distributed_database_v26_service_cli.py b/services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/distributed_database_v26_service_cli.py new file mode 100644 index 000000000..edacdf34d --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_database_v26/generated/distributed_database_v26_service_cli.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +from oci_cli.cli_root import cli +from oci_cli import cli_util +from oci_cli.aliasing import CommandGroupWithAlias + + +@cli.command(cli_util.override('distributed_db_work_request_service.distributed_database_v26_service_group.command_name', 'distributed-database-v26'), cls=CommandGroupWithAlias, help=cli_util.override('distributed_db_work_request_service.distributed_database_v26_service_group.help', """Use the Globally Distributed Database service APIs to create and manage the Globally distributed databases."""), short_help=cli_util.override('distributed_db_work_request_service.distributed_database_v26_service_group.short_help', """Globally Distributed Database""")) +@cli_util.help_option_group +def distributed_database_v26_service_group(): + pass diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/client_mappings.py b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/client_mappings.py new file mode 100644 index 000000000..c2a131aad --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/client_mappings.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +import oci +from oci_cli.cli_clients import CLIENT_MAP +from oci_cli.cli_clients import MODULE_TO_TYPE_MAPPINGS +from oci.distributed_database_v26 import DistributedDbPrivateEndpointServiceClient + +MODULE_TO_TYPE_MAPPINGS["distributed_database_v26"] = oci.distributed_database_v26.models.distributed_database_v26_type_mapping +if CLIENT_MAP.get("distributed_database_v26") is None: + CLIENT_MAP["distributed_database_v26"] = {} +CLIENT_MAP["distributed_database_v26"]["distributed_db_private_endpoint_service"] = DistributedDbPrivateEndpointServiceClient diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/distributeddbprivateendpointservice_cli.py b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/distributeddbprivateendpointservice_cli.py new file mode 100644 index 000000000..8880dc10c --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_private_endpoint_service/generated/distributeddbprivateendpointservice_cli.py @@ -0,0 +1,515 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +from __future__ import print_function +import click +import oci # noqa: F401 +import six # noqa: F401 +import sys # noqa: F401 +from oci_cli import cli_constants # noqa: F401 +from oci_cli import cli_util +from oci_cli import json_skeleton_utils +from oci_cli import custom_types # noqa: F401 +from oci_cli.aliasing import CommandGroupWithAlias +from services.distributed_database_v26.src.oci_cli_distributed_database_v26.generated import distributed_database_v26_service_cli + + +@click.command(cli_util.override('distributed_db_private_endpoint_service.distributed_db_private_endpoint_service_root_group.command_name', 'distributed-db-private-endpoint-service'), cls=CommandGroupWithAlias, help=cli_util.override('distributed_db_private_endpoint_service.distributed_db_private_endpoint_service_root_group.help', """Use the Globally Distributed Database service APIs to create and manage the Globally distributed databases."""), short_help=cli_util.override('distributed_db_private_endpoint_service.distributed_db_private_endpoint_service_root_group.short_help', """Globally Distributed Database""")) +@cli_util.help_option_group +def distributed_db_private_endpoint_service_root_group(): + pass + + +@click.command(cli_util.override('distributed_db_private_endpoint_service.distributed_database_private_endpoint_collection_group.command_name', 'distributed-database-private-endpoint-collection'), cls=CommandGroupWithAlias, help="""Collection of private endpoints.""") +@cli_util.help_option_group +def distributed_database_private_endpoint_collection_group(): + pass + + +@click.command(cli_util.override('distributed_db_private_endpoint_service.distributed_database_private_endpoint_group.command_name', 'distributed-database-private-endpoint'), cls=CommandGroupWithAlias, help="""DistributedDatabasePrivateEndpoint resource.""") +@cli_util.help_option_group +def distributed_database_private_endpoint_group(): + pass + + +distributed_database_v26_service_cli.distributed_database_v26_service_group.add_command(distributed_db_private_endpoint_service_root_group) +distributed_db_private_endpoint_service_root_group.add_command(distributed_database_private_endpoint_collection_group) +distributed_db_private_endpoint_service_root_group.add_command(distributed_database_private_endpoint_group) + + +@distributed_database_private_endpoint_group.command(name=cli_util.override('distributed_db_private_endpoint_service.change_distributed_database_private_endpoint_compartment.command_name', 'change-compartment'), help=u"""Moves the DistributedDatabasePrivateEndpoint to the specified compartment. \n[Command Reference](changeDistributedDatabasePrivateEndpointCompartment)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to move the resource to.""") +@cli_util.option('--distributed-database-private-endpoint-id', required=True, help=u"""Distributed Database PrivateEndpoint identifier""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def change_distributed_database_private_endpoint_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, distributed_database_private_endpoint_id, if_match): + + if isinstance(distributed_database_private_endpoint_id, six.string_types) and len(distributed_database_private_endpoint_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-private-endpoint-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + result = client.change_distributed_database_private_endpoint_compartment( + distributed_database_private_endpoint_id=distributed_database_private_endpoint_id, + change_distributed_database_private_endpoint_compartment_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_private_endpoint_group.command(name=cli_util.override('distributed_db_private_endpoint_service.create_distributed_database_private_endpoint.command_name', 'create'), help=u"""Creates a DistributedDatabasePrivateEndpoint. \n[Command Reference](createDistributedDatabasePrivateEndpoint)""") +@cli_util.option('--compartment-id', required=True, help=u"""Identifier of the compartment where private endpoint is to be created.""") +@cli_util.option('--subnet-id', required=True, help=u"""Identifier of the customer subnet against which private endpoint is to be created.""") +@cli_util.option('--display-name', required=True, help=u"""Private endpoint display name.""") +@cli_util.option('--description', help=u"""DistributedDatabasePrivateEndpoint description.""") +@cli_util.option('--vcn-nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of network security group (NSG) details to be associated with the private endpoint. + +This option is a JSON list with items of type VcnNsgIdsDetails. For documentation on VcnNsgIdsDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbprivateendpointservice/20260101/datatypes/VcnNsgIdsDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'vcn-nsg-ids': {'module': 'distributed_database_v26', 'class': 'list[VcnNsgIdsDetails]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'vcn-nsg-ids': {'module': 'distributed_database_v26', 'class': 'list[VcnNsgIdsDetails]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabasePrivateEndpoint'}) +@cli_util.wrap_exceptions +def create_distributed_database_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subnet_id, display_name, description, vcn_nsg_ids, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + _details['subnetId'] = subnet_id + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if vcn_nsg_ids is not None: + _details['vcnNsgIds'] = cli_util.parse_json_parameter("vcn_nsg_ids", vcn_nsg_ids) + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + result = client.create_distributed_database_private_endpoint( + create_distributed_database_private_endpoint_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_private_endpoint_group.command(name=cli_util.override('distributed_db_private_endpoint_service.delete_distributed_database_private_endpoint.command_name', 'delete'), help=u"""Deletes the given DistributedDatabasePrivateEndpoint. \n[Command Reference](deleteDistributedDatabasePrivateEndpoint)""") +@cli_util.option('--distributed-database-private-endpoint-id', required=True, help=u"""Distributed Database PrivateEndpoint identifier""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.confirm_delete_option +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def delete_distributed_database_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_private_endpoint_id, if_match): + + if isinstance(distributed_database_private_endpoint_id, six.string_types) and len(distributed_database_private_endpoint_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-private-endpoint-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + result = client.delete_distributed_database_private_endpoint( + distributed_database_private_endpoint_id=distributed_database_private_endpoint_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_private_endpoint_group.command(name=cli_util.override('distributed_db_private_endpoint_service.get_distributed_database_private_endpoint.command_name', 'get'), help=u"""Get the DistributedDatabasePrivateEndpoint resource. \n[Command Reference](getDistributedDatabasePrivateEndpoint)""") +@cli_util.option('--distributed-database-private-endpoint-id', required=True, help=u"""Distributed Database PrivateEndpoint identifier""") +@cli_util.option('--if-none-match', help=u"""For conditional requests. In the GET call for a resource, set the `If-None-Match` header to the value of the ETag from a previous GET (or POST or PUT) response for that resource. The server will return with either a 304 Not Modified response if the resource has not changed, or a 200 OK response with the updated representation.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabasePrivateEndpoint'}) +@cli_util.wrap_exceptions +def get_distributed_database_private_endpoint(ctx, from_json, distributed_database_private_endpoint_id, if_none_match): + + if isinstance(distributed_database_private_endpoint_id, six.string_types) and len(distributed_database_private_endpoint_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-private-endpoint-id cannot be whitespace or empty string') + + kwargs = {} + if if_none_match is not None: + kwargs['if_none_match'] = if_none_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + result = client.get_distributed_database_private_endpoint( + distributed_database_private_endpoint_id=distributed_database_private_endpoint_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_private_endpoint_collection_group.command(name=cli_util.override('distributed_db_private_endpoint_service.list_distributed_database_private_endpoints.command_name', 'list-distributed-database-private-endpoints'), help=u"""List of DistributedDatabasePrivateEndpoints. \n[Command Reference](listDistributedDatabasePrivateEndpoints)""") +@cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""") +@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""When set to true, returns resources in the specified compartment and in all of its child compartments recursively. Defaults to false.""") +@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "FAILED", "INACTIVE", "DELETING", "DELETED", "UPDATING", "CREATING"]), help=u"""A filter to return only resources their lifecycleState matches the given lifecycleState.""") +@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") +@cli_util.option('--page', help=u"""A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "timeUpdated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""") +@cli_util.option('--display-name', help=u"""A filter to return only private endpoint that match the entire name given. The match is not case sensitive.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabasePrivateEndpointCollection'}) +@cli_util.wrap_exceptions +def list_distributed_database_private_endpoints(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, lifecycle_state, limit, page, sort_order, sort_by, display_name): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + kwargs = {} + if compartment_id_in_subtree is not None: + kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree + if lifecycle_state is not None: + kwargs['lifecycle_state'] = lifecycle_state + if limit is not None: + kwargs['limit'] = limit + if page is not None: + kwargs['page'] = page + if sort_order is not None: + kwargs['sort_order'] = sort_order + if sort_by is not None: + kwargs['sort_by'] = sort_by + if display_name is not None: + kwargs['display_name'] = display_name + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_distributed_database_private_endpoints, + compartment_id=compartment_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_distributed_database_private_endpoints, + limit, + page_size, + compartment_id=compartment_id, + **kwargs + ) + else: + result = client.list_distributed_database_private_endpoints( + compartment_id=compartment_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_private_endpoint_group.command(name=cli_util.override('distributed_db_private_endpoint_service.patch_distributed_database_private_endpoint.command_name', 'patch'), help=u"""Patch operation to update VCN network security group (NSG) IDs associated with the DistributedDatabasePrivateEndpoint. \n[Command Reference](patchDistributedDatabasePrivateEndpoint)""") +@cli_util.option('--distributed-database-private-endpoint-id', required=True, help=u"""Distributed Database PrivateEndpoint identifier""") +@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of patch instructions. + +This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbprivateendpointservice/20260101/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'distributed_database_v26', 'class': 'list[PatchInstruction]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'distributed_database_v26', 'class': 'list[PatchInstruction]'}}) +@cli_util.wrap_exceptions +def patch_distributed_database_private_endpoint(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_private_endpoint_id, items, if_match): + + if isinstance(distributed_database_private_endpoint_id, six.string_types) and len(distributed_database_private_endpoint_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-private-endpoint-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + if items is not None: + _details['items'] = cli_util.parse_json_parameter("items", items) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + result = client.patch_distributed_database_private_endpoint( + distributed_database_private_endpoint_id=distributed_database_private_endpoint_id, + patch_distributed_database_private_endpoint_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_private_endpoint_group.command(name=cli_util.override('distributed_db_private_endpoint_service.reinstate_proxy_instance.command_name', 'reinstate-proxy-instance'), help=u"""Reinstates the proxy instance associated with the DistributedDatabasePrivateEndpoint. \n[Command Reference](reinstateProxyInstance)""") +@cli_util.option('--distributed-database-private-endpoint-id', required=True, help=u"""Distributed Database PrivateEndpoint identifier""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def reinstate_proxy_instance(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_private_endpoint_id, if_match): + + if isinstance(distributed_database_private_endpoint_id, six.string_types) and len(distributed_database_private_endpoint_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-private-endpoint-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + result = client.reinstate_proxy_instance( + distributed_database_private_endpoint_id=distributed_database_private_endpoint_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_private_endpoint_group.command(name=cli_util.override('distributed_db_private_endpoint_service.update_distributed_database_private_endpoint.command_name', 'update'), help=u"""Updates the configuration of DistributedDatabasePrivateEndpoint. \n[Command Reference](updateDistributedDatabasePrivateEndpoint)""") +@cli_util.option('--distributed-database-private-endpoint-id', required=True, help=u"""Distributed Database PrivateEndpoint identifier""") +@cli_util.option('--display-name', help=u"""Display name for DistributedDatabasePrivateEndpoint""") +@cli_util.option('--description', help=u"""DistributedDatabasePrivateEndpoint description.""") +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "FAILED", "INACTIVE", "DELETING", "DELETED", "UPDATING", "CREATING"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACTIVE --wait-for-state CREATING would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabasePrivateEndpoint'}) +@cli_util.wrap_exceptions +def update_distributed_database_private_endpoint(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_private_endpoint_id, display_name, description, freeform_tags, defined_tags, if_match): + + if isinstance(distributed_database_private_endpoint_id, six.string_types) and len(distributed_database_private_endpoint_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-private-endpoint-id cannot be whitespace or empty string') + if not force: + if freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"): + ctx.abort() + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_private_endpoint_service', ctx) + result = client.update_distributed_database_private_endpoint( + distributed_database_private_endpoint_id=distributed_database_private_endpoint_id, + update_distributed_database_private_endpoint_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_distributed_database_private_endpoint') and callable(getattr(client, 'get_distributed_database_private_endpoint')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + + click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_distributed_database_private_endpoint(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_service/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_db_service/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_service/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/client_mappings.py b/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/client_mappings.py new file mode 100644 index 000000000..33751ae73 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/client_mappings.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +import oci +from oci_cli.cli_clients import CLIENT_MAP +from oci_cli.cli_clients import MODULE_TO_TYPE_MAPPINGS +from oci.distributed_database_v26 import DistributedDbServiceClient + +MODULE_TO_TYPE_MAPPINGS["distributed_database_v26"] = oci.distributed_database_v26.models.distributed_database_v26_type_mapping +if CLIENT_MAP.get("distributed_database_v26") is None: + CLIENT_MAP["distributed_database_v26"] = {} +CLIENT_MAP["distributed_database_v26"]["distributed_db_service"] = DistributedDbServiceClient diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/distributeddbservice_cli.py b/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/distributeddbservice_cli.py new file mode 100644 index 000000000..269bbfc6d --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_service/generated/distributeddbservice_cli.py @@ -0,0 +1,1364 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +from __future__ import print_function +import click +import oci # noqa: F401 +import six # noqa: F401 +import sys # noqa: F401 +from oci_cli import cli_constants # noqa: F401 +from oci_cli import cli_util +from oci_cli import json_skeleton_utils +from oci_cli import custom_types # noqa: F401 +from oci_cli.aliasing import CommandGroupWithAlias +from services.distributed_database_v26.src.oci_cli_distributed_database_v26.generated import distributed_database_v26_service_cli + + +@click.command(cli_util.override('distributed_db_service.distributed_db_service_root_group.command_name', 'distributed-db-service'), cls=CommandGroupWithAlias, help=cli_util.override('distributed_db_service.distributed_db_service_root_group.help', """Use the Globally Distributed Database service APIs to create and manage the Globally distributed databases."""), short_help=cli_util.override('distributed_db_service.distributed_db_service_root_group.short_help', """Globally Distributed Database""")) +@cli_util.help_option_group +def distributed_db_service_root_group(): + pass + + +@click.command(cli_util.override('distributed_db_service.distributed_database_collection_group.command_name', 'distributed-database-collection'), cls=CommandGroupWithAlias, help="""Collection of Globally distributed databases.""") +@cli_util.help_option_group +def distributed_database_collection_group(): + pass + + +@click.command(cli_util.override('distributed_db_service.distributed_database_group.command_name', 'distributed-database'), cls=CommandGroupWithAlias, help="""Globally distributed database.""") +@cli_util.help_option_group +def distributed_database_group(): + pass + + +distributed_database_v26_service_cli.distributed_database_v26_service_group.add_command(distributed_db_service_root_group) +distributed_db_service_root_group.add_command(distributed_database_collection_group) +distributed_db_service_root_group.add_command(distributed_database_group) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.add_distributed_database_gds_control_node.command_name', 'add'), help=u"""Add new Global database services control(GDS CTL) node for the Globally distributed database. \n[Command Reference](addDistributedDatabaseGdsControlNode)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--public-ssh-key', required=True, help=u"""The public sshKey for Global database services control(GDS CTL) node.""") +@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet on which the Global database services control(GDS CTL) node should be created.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def add_distributed_database_gds_control_node(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, public_ssh_key, subnet_id, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['publicSshKey'] = public_ssh_key + + if subnet_id is not None: + _details['subnetId'] = subnet_id + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.add_distributed_database_gds_control_node( + distributed_database_id=distributed_database_id, + add_distributed_database_gds_control_node_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.change_distributed_database_compartment.command_name', 'change-compartment'), help=u"""Move the Globally distributed database and its dependent resources to the specified compartment. \n[Command Reference](changeDistributedDatabaseCompartment)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to move the resource to.""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def change_distributed_database_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, distributed_database_id, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.change_distributed_database_compartment( + distributed_database_id=distributed_database_id, + change_distributed_database_compartment_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.change_distributed_db_backup_config.command_name', 'change-distributed-db-backup-config'), help=u"""Change the DbBackupConfig for the Globally distributed database. \n[Command Reference](changeDistributedDbBackupConfig)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--db-backup-config', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedDbBackupConfig'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedDbBackupConfig'}}) +@cli_util.wrap_exceptions +def change_distributed_db_backup_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, db_backup_config, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['dbBackupConfig'] = cli_util.parse_json_parameter("db_backup_config", db_backup_config) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.change_distributed_db_backup_config( + distributed_database_id=distributed_database_id, + change_distributed_db_backup_config_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.configure_distributed_database_auto_resource_management.command_name', 'configure-distributed-database-auto-resource-management'), help=u"""Configure autoResourceManagement options for the Globally distributed database. \n[Command Reference](configureDistributedDatabaseAutoResourceManagement)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--is-enabled', required=True, type=click.BOOL, help=u"""Flag indicating if autoResourceManagement is enabled or disabled.""") +@cli_util.option('--cool-off-period-in-minutes', type=click.INT, help=u"""Time period to wait for the database to get stable after autoResourceManagement event.""") +@cli_util.option('--max-move-ru-attempts', type=click.INT, help=u"""Maximum number of move replication unit attempts allowed within the configured period per database.""") +@cli_util.option('--max-move-ru-unit', type=custom_types.CliCaseInsensitiveChoice(["HOUR", "DAY"]), help=u"""Time unit applicable to maxMoveRuAttempts.""") +@cli_util.option('--mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "RECOMMENDATION"]), help=u"""Mode of autoResourceManagement execution.""") +@cli_util.option('--action-type', type=custom_types.CliCaseInsensitiveChoice(["MOVE"]), help=u"""The action that will be taken when autoResourceManagement is triggered.""") +@cli_util.option('--notification-topic-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of notification topic ids [OCIDs] to receive autoResourceManagement events.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--stream-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of stream ids [OCIDs] that receive shard-related telemetry.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@json_skeleton_utils.get_cli_json_input_option({'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'stream-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'stream-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabaseAutoResourceManagementDetails'}) +@cli_util.wrap_exceptions +def configure_distributed_database_auto_resource_management(ctx, from_json, distributed_database_id, is_enabled, cool_off_period_in_minutes, max_move_ru_attempts, max_move_ru_unit, mode, action_type, notification_topic_ids, stream_ids, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['isEnabled'] = is_enabled + + if cool_off_period_in_minutes is not None: + _details['coolOffPeriodInMinutes'] = cool_off_period_in_minutes + + if max_move_ru_attempts is not None: + _details['maxMoveRuAttempts'] = max_move_ru_attempts + + if max_move_ru_unit is not None: + _details['maxMoveRuUnit'] = max_move_ru_unit + + if mode is not None: + _details['mode'] = mode + + if action_type is not None: + _details['actionType'] = action_type + + if notification_topic_ids is not None: + _details['notificationTopicIds'] = cli_util.parse_json_parameter("notification_topic_ids", notification_topic_ids) + + if stream_ids is not None: + _details['streamIds'] = cli_util.parse_json_parameter("stream_ids", stream_ids) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.configure_distributed_database_auto_resource_management( + distributed_database_id=distributed_database_id, + configure_distributed_database_auto_resource_management_details=_details, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.configure_distributed_database_gsms.command_name', 'configure-distributed-database-gsms'), help=u"""Configure new Global Service Manager(GSM aka shard manager) instances for the Globally distributed database. \n[Command Reference](configureDistributedDatabaseGsms)""") +@cli_util.option('--old-gsm-names', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Names of old global service manager(GSM) instances corresponding to which new GSM instances need to be configured.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--is-latest-gsm-image', required=True, type=click.BOOL, help=u"""Flag to indicate if new global service manager(GSM) instances shall use latest image or re-use image used by existing GSM instances.""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'old-gsm-names': {'module': 'distributed_database_v26', 'class': 'list[string]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'old-gsm-names': {'module': 'distributed_database_v26', 'class': 'list[string]'}}) +@cli_util.wrap_exceptions +def configure_distributed_database_gsms(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, old_gsm_names, is_latest_gsm_image, distributed_database_id, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['oldGsmNames'] = cli_util.parse_json_parameter("old_gsm_names", old_gsm_names) + _details['isLatestGsmImage'] = is_latest_gsm_image + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.configure_distributed_database_gsms( + distributed_database_id=distributed_database_id, + configure_distributed_database_gsms_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.configure_distributed_database_sharding.command_name', 'configure-distributed-database-sharding'), help=u"""Once all components of Globally distributed database are provisioned, and signed GSM certificates are successfully uploaded, this api shall be invoked to configure sharding on the Globally distributed database. Note that this 'ConfigureSharding' API also needs to be invoked after successfully adding a new shard to the Globally distributed database using PATCH api. If this API is not invoked after successfully adding a new shard, then that new shard will not be a participant in sharding topology of the Globally distributed database. \n[Command Reference](configureDistributedDatabaseSharding)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--is-rebalance-required', type=click.BOOL, help=u"""The flag to indicate whether chunks need to be re-balanced. This flag is not applicable for USER-defined sharding type.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def configure_distributed_database_sharding(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, is_rebalance_required, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if is_rebalance_required is not None: + kwargs['is_rebalance_required'] = is_rebalance_required + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.configure_distributed_database_sharding( + distributed_database_id=distributed_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.create_distributed_database.command_name', 'create'), help=u"""Creates a Globally distributed database. \n[Command Reference](createDistributedDatabase)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the Globally distributed database compartment.""") +@cli_util.option('--display-name', required=True, help=u"""The display name of the Globally distributed database.""") +@cli_util.option('--database-version', required=True, help=u"""Oracle Database version for the shards and catalog used in Globally distributed database.""") +@cli_util.option('--prefix', required=True, help=u"""Unique name prefix for the Globally distributed databases. Only alpha-numeric values are allowed. First character has to be a letter followed by any combination of letter and number.""") +@cli_util.option('--private-endpoint-ids', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of [OCID] of the private endpoints associated with the Globally distributed database.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--character-set', required=True, help=u"""The character set for the database.""") +@cli_util.option('--ncharacter-set', required=True, help=u"""The national character set for the database.""") +@cli_util.option('--listener-port', required=True, type=click.INT, help=u"""The listener port number for the Globally distributed database. The listener port number has to be unique for a customer tenancy across all distributed databases. Same port number should not be re-used for any other distributed database.""") +@cli_util.option('--ons-port-local', required=True, type=click.INT, help=u"""The ons local port number for the Globally distributed database. The onsPortLocal has to be unique for a customer tenancy across all distributed databases. Same port number should not be re-used for any other distributed database.""") +@cli_util.option('--ons-port-remote', required=True, type=click.INT, help=u"""The ons remote port number for the Globally distributed database. The onsPortRemote has to be unique for a customer tenancy across all distributed databases. Same port number should not be re-used for any other distributed database.""") +@cli_util.option('--catalog-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of catalog details for the Globally distributed database.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--notification-topic-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of [OCID] for the notification topics associated with the globally distributed database.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--listener-port-tls', type=click.INT, help=u"""The TLS listener port number for the Globally distributed database. The TLS listener port number has to be unique for a customer tenancy across all distributed databases. Same port number should not be re-used for any other distributed database. For EXADB based distributed databases, tls is not supported hence the listenerPortTls is not needed to be provided in create payload.""") +@cli_util.option('--scan-listener-port', type=click.INT, help=u"""TCP SCAN listener port for new clusters to be created. Applicable only when shard and catalog source types are XS_NEW_VAULT_AND_CLUSTER or XS_NEW_CLUSTER. Defaults to 1521 when not provided.""") +@cli_util.option('--system-chunk-count', type=click.INT, help=u"""Count of chunks associated with system raft clusters or system data guard databases.""") +@cli_util.option('--system-raft-replication-unit-count', type=click.INT, help=u"""Number of replication units associated with system raft clusters.""") +@cli_util.option('--composite-raft-shard-spaces', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of composite raft shards. + +This option is a JSON list with items of type CreateCompositeRaftShardSpaceDetails. For documentation on CreateCompositeRaftShardSpaceDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbservice/20260101/datatypes/CreateCompositeRaftShardSpaceDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--composite-data-guard-shard-spaces', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of composite data guard shard spaces. + +This option is a JSON list with items of type CreateCompositeDataGuardShardSpaceDetails. For documentation on CreateCompositeDataGuardShardSpaceDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbservice/20260101/datatypes/CreateCompositeDataGuardShardSpaceDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--system-raft-clusters', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of system raft clusters. + +This option is a JSON list with items of type CreateSystemRaftClusterDetails. For documentation on CreateSystemRaftClusterDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbservice/20260101/datatypes/CreateSystemRaftClusterDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--system-data-guard-databases', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--user-shard-spaces', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of user defined shard spaces. + +This option is a JSON list with items of type CreateUserShardSpaceDetails. For documentation on CreateUserShardSpaceDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbservice/20260101/datatypes/CreateUserShardSpaceDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--gsm-ssh-public-key', help=u"""The SSH public key for Global service manager instances.""") +@cli_util.option('--db-backup-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--vcn-nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of network security group (NSG) details to be associated with the distributed database. + +This option is a JSON list with items of type VcnNsgIdsDetails. For documentation on VcnNsgIdsDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbservice/20260101/datatypes/VcnNsgIdsDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'private-endpoint-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'composite-raft-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateCompositeRaftShardSpaceDetails]'}, 'composite-data-guard-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateCompositeDataGuardShardSpaceDetails]'}, 'system-raft-clusters': {'module': 'distributed_database_v26', 'class': 'list[CreateSystemRaftClusterDetails]'}, 'system-data-guard-databases': {'module': 'distributed_database_v26', 'class': 'CreateSystemDataGuardDatabaseDetails'}, 'user-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateUserShardSpaceDetails]'}, 'catalog-details': {'module': 'distributed_database_v26', 'class': 'list[CreateDistributedDatabaseCatalogDetails]'}, 'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedDbBackupConfig'}, 'vcn-nsg-ids': {'module': 'distributed_database_v26', 'class': 'list[VcnNsgIdsDetails]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'private-endpoint-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'composite-raft-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateCompositeRaftShardSpaceDetails]'}, 'composite-data-guard-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateCompositeDataGuardShardSpaceDetails]'}, 'system-raft-clusters': {'module': 'distributed_database_v26', 'class': 'list[CreateSystemRaftClusterDetails]'}, 'system-data-guard-databases': {'module': 'distributed_database_v26', 'class': 'CreateSystemDataGuardDatabaseDetails'}, 'user-shard-spaces': {'module': 'distributed_database_v26', 'class': 'list[CreateUserShardSpaceDetails]'}, 'catalog-details': {'module': 'distributed_database_v26', 'class': 'list[CreateDistributedDatabaseCatalogDetails]'}, 'db-backup-config': {'module': 'distributed_database_v26', 'class': 'DistributedDbBackupConfig'}, 'vcn-nsg-ids': {'module': 'distributed_database_v26', 'class': 'list[VcnNsgIdsDetails]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabase'}) +@cli_util.wrap_exceptions +def create_distributed_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, database_version, prefix, private_endpoint_ids, character_set, ncharacter_set, listener_port, ons_port_local, ons_port_remote, catalog_details, notification_topic_ids, listener_port_tls, scan_listener_port, system_chunk_count, system_raft_replication_unit_count, composite_raft_shard_spaces, composite_data_guard_shard_spaces, system_raft_clusters, system_data_guard_databases, user_shard_spaces, gsm_ssh_public_key, db_backup_config, vcn_nsg_ids, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + _details['displayName'] = display_name + _details['databaseVersion'] = database_version + _details['prefix'] = prefix + _details['privateEndpointIds'] = cli_util.parse_json_parameter("private_endpoint_ids", private_endpoint_ids) + _details['characterSet'] = character_set + _details['ncharacterSet'] = ncharacter_set + _details['listenerPort'] = listener_port + _details['onsPortLocal'] = ons_port_local + _details['onsPortRemote'] = ons_port_remote + _details['catalogDetails'] = cli_util.parse_json_parameter("catalog_details", catalog_details) + + if notification_topic_ids is not None: + _details['notificationTopicIds'] = cli_util.parse_json_parameter("notification_topic_ids", notification_topic_ids) + + if listener_port_tls is not None: + _details['listenerPortTls'] = listener_port_tls + + if scan_listener_port is not None: + _details['scanListenerPort'] = scan_listener_port + + if system_chunk_count is not None: + _details['systemChunkCount'] = system_chunk_count + + if system_raft_replication_unit_count is not None: + _details['systemRaftReplicationUnitCount'] = system_raft_replication_unit_count + + if composite_raft_shard_spaces is not None: + _details['compositeRaftShardSpaces'] = cli_util.parse_json_parameter("composite_raft_shard_spaces", composite_raft_shard_spaces) + + if composite_data_guard_shard_spaces is not None: + _details['compositeDataGuardShardSpaces'] = cli_util.parse_json_parameter("composite_data_guard_shard_spaces", composite_data_guard_shard_spaces) + + if system_raft_clusters is not None: + _details['systemRaftClusters'] = cli_util.parse_json_parameter("system_raft_clusters", system_raft_clusters) + + if system_data_guard_databases is not None: + _details['systemDataGuardDatabases'] = cli_util.parse_json_parameter("system_data_guard_databases", system_data_guard_databases) + + if user_shard_spaces is not None: + _details['userShardSpaces'] = cli_util.parse_json_parameter("user_shard_spaces", user_shard_spaces) + + if gsm_ssh_public_key is not None: + _details['gsmSshPublicKey'] = gsm_ssh_public_key + + if db_backup_config is not None: + _details['dbBackupConfig'] = cli_util.parse_json_parameter("db_backup_config", db_backup_config) + + if vcn_nsg_ids is not None: + _details['vcnNsgIds'] = cli_util.parse_json_parameter("vcn_nsg_ids", vcn_nsg_ids) + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.create_distributed_database( + create_distributed_database_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.delete_distributed_database.command_name', 'delete'), help=u"""Terminate the given Globally distributed database. \n[Command Reference](deleteDistributedDatabase)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.confirm_delete_option +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def delete_distributed_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.delete_distributed_database( + distributed_database_id=distributed_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Please retrieve the work request to find its current state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.generate_distributed_database_wallet.command_name', 'generate-distributed-database-wallet'), help=u"""Generate the wallet associated with Globally distributed database. \n[Command Reference](generateDistributedDatabaseWallet)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--password', required=True, help=u"""The password to encrypt the keys inside the wallet. The password must be at least 8 characters long and must include at least 1 letter and either 1 numeric character or 1 special character.""") +@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def generate_distributed_database_wallet(ctx, from_json, file, distributed_database_id, password, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['password'] = password + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.generate_distributed_database_wallet( + distributed_database_id=distributed_database_id, + generate_distributed_database_wallet_details=_details, + **kwargs + ) + + # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output + # Also we need a non-zero Content-Length in order to display a meaningful progress bar + bar = None + if hasattr(file, 'name') and file.name != '' and 'Content-Length' in result.headers: + content_length = int(result.headers['Content-Length']) + if content_length > 0: + bar = click.progressbar(length=content_length, label='Downloading file') + + try: + if bar: + bar.__enter__() + + # TODO: Make the download size a configurable option + # use decode_content=True to automatically unzip service responses (this should be overridden for object storage) + for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True): + if bar: + bar.update(len(chunk)) + file.write(chunk) + finally: + if bar: + bar.render_finish() + file.close() + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.get_distributed_database.command_name', 'get'), help=u"""Gets the details of the Globally distributed database identified by given id. \n[Command Reference](getDistributedDatabase)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--metadata', help=u"""Comma-separated argument names for which metadata should be retrieved.""") +@cli_util.option('--if-none-match', help=u"""For conditional requests. In the GET call for a resource, set the `If-None-Match` header to the value of the ETag from a previous GET (or POST or PUT) response for that resource. The server will return with either a 304 Not Modified response if the resource has not changed, or a 200 OK response with the updated representation.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabase'}) +@cli_util.wrap_exceptions +def get_distributed_database(ctx, from_json, distributed_database_id, metadata, if_none_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if metadata is not None: + kwargs['metadata'] = metadata + if if_none_match is not None: + kwargs['if_none_match'] = if_none_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.get_distributed_database( + distributed_database_id=distributed_database_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.get_distributed_database_raft_metric.command_name', 'get-distributed-database-raft-metric'), help=u"""Operation to retrieve RAFT metrics for the Globally distributed database. If the Globally distributed database is not RAFT based then empty response is returned from the API. \n[Command Reference](getDistributedDatabaseRaftMetric)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabaseRaftMetric'}) +@cli_util.wrap_exceptions +def get_distributed_database_raft_metric(ctx, from_json, distributed_database_id): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.get_distributed_database_raft_metric( + distributed_database_id=distributed_database_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.get_distributed_database_ru_change_log.command_name', 'get-distributed-database-ru-change-log'), help=u"""Operation to retrieve move RU invocation history and status for the Globally distributed database. Results are ordered by created timestamp in descending order. \n[Command Reference](getDistributedDatabaseRuChangeLog)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--source-shard-name', help=u"""The source shard name to filter RU change log entries.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabaseRuChangeLog'}) +@cli_util.wrap_exceptions +def get_distributed_database_ru_change_log(ctx, from_json, distributed_database_id, source_shard_name): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if source_shard_name is not None: + kwargs['source_shard_name'] = source_shard_name + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.get_distributed_database_ru_change_log( + distributed_database_id=distributed_database_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_collection_group.command(name=cli_util.override('distributed_db_service.list_distributed_databases.command_name', 'list-distributed-databases'), help=u"""List of Globally distributed databases. \n[Command Reference](listDistributedDatabases)""") +@cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""") +@cli_util.option('--compartment-id-in-subtree', type=click.BOOL, help=u"""When set to true, returns resources in the specified compartment and in all of its child compartments recursively. Defaults to false.""") +@cli_util.option('--private-endpoint-id', help=u"""A filter to return only resources that are associated with the given privateEndpointId.""") +@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "FAILED", "NEEDS_ATTENTION", "INACTIVE", "DELETING", "DELETED", "UPDATING", "CREATING"]), help=u"""A filter to return only resources whose lifecycleState matches the specified value.""") +@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") +@cli_util.option('--page', help=u"""A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "timeUpdated"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.""") +@cli_util.option('--is-auto-resource-management-enabled', type=click.BOOL, help=u"""A filter to return only resources where autoResourceManagement is enabled when set to `true`, or disabled when set to `false`. If omitted, no autoResourceManagement-based filtering is applied.""") +@cli_util.option('--display-name', help=u"""A filter to return only Globally distributed databases that match the entire name given. The match is not case sensitive.""") +@cli_util.option('--db-deployment-type', help=u"""A filter to return only resources whose dbDeploymentType matches the specified value.""") +@cli_util.option('--metadata', help=u"""Comma-separated argument names for which metadata should be retrieved.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabaseCollection'}) +@cli_util.wrap_exceptions +def list_distributed_databases(ctx, from_json, all_pages, page_size, compartment_id, compartment_id_in_subtree, private_endpoint_id, lifecycle_state, limit, page, sort_order, sort_by, is_auto_resource_management_enabled, display_name, db_deployment_type, metadata): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + kwargs = {} + if compartment_id_in_subtree is not None: + kwargs['compartment_id_in_subtree'] = compartment_id_in_subtree + if private_endpoint_id is not None: + kwargs['private_endpoint_id'] = private_endpoint_id + if lifecycle_state is not None: + kwargs['lifecycle_state'] = lifecycle_state + if limit is not None: + kwargs['limit'] = limit + if page is not None: + kwargs['page'] = page + if sort_order is not None: + kwargs['sort_order'] = sort_order + if sort_by is not None: + kwargs['sort_by'] = sort_by + if is_auto_resource_management_enabled is not None: + kwargs['is_auto_resource_management_enabled'] = is_auto_resource_management_enabled + if display_name is not None: + kwargs['display_name'] = display_name + if db_deployment_type is not None: + kwargs['db_deployment_type'] = db_deployment_type + if metadata is not None: + kwargs['metadata'] = metadata + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_distributed_databases, + compartment_id=compartment_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_distributed_databases, + limit, + page_size, + compartment_id=compartment_id, + **kwargs + ) + else: + result = client.list_distributed_databases( + compartment_id=compartment_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.move_distributed_database_replication_unit.command_name', 'move-distributed-database-replication-unit'), help=u"""Move the replication units for RAFT based globally distributed database from source shard to destination shard. \n[Command Reference](moveDistributedDatabaseReplicationUnit)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--source-shard-name', required=True, help=u"""The name of the source shard from which to move the chunks out to other shards.""") +@cli_util.option('--destination-shard-name', help=u"""The name of the destination shard to which the chunks moved out from source shard should be relocate to.""") +@cli_util.option('--replication-units', type=custom_types.CLI_COMPLEX_TYPE, help=u"""For RAFT databases please provide replication unit numbers to be moved from source shard to destination shard.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'replication-units': {'module': 'distributed_database_v26', 'class': 'list[integer]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'replication-units': {'module': 'distributed_database_v26', 'class': 'list[integer]'}}) +@cli_util.wrap_exceptions +def move_distributed_database_replication_unit(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, source_shard_name, destination_shard_name, replication_units, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['sourceShardName'] = source_shard_name + + if destination_shard_name is not None: + _details['destinationShardName'] = destination_shard_name + + if replication_units is not None: + _details['replicationUnits'] = cli_util.parse_json_parameter("replication_units", replication_units) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.move_distributed_database_replication_unit( + distributed_database_id=distributed_database_id, + move_distributed_database_replication_unit_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.patch_distributed_database.command_name', 'patch'), help=u"""Patch operation to add, remove or update shards to the Globally distributed database topology. In single patch operation, multiple shards can be either added, or removed or updated. Combination of inserts, update and remove in single operation is not allowed. \n[Command Reference](patchDistributedDatabase)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--items', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of patch instructions. + +This option is a JSON list with items of type PatchInstruction. For documentation on PatchInstruction please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/distributeddbservice/20260101/datatypes/PatchInstruction.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'items': {'module': 'distributed_database_v26', 'class': 'list[PatchInstruction]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'items': {'module': 'distributed_database_v26', 'class': 'list[PatchInstruction]'}}) +@cli_util.wrap_exceptions +def patch_distributed_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, items, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + if items is not None: + _details['items'] = cli_util.parse_json_parameter("items", items) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.patch_distributed_database( + distributed_database_id=distributed_database_id, + patch_distributed_database_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.recreate_failed_distributed_database_resource.command_name', 'recreate-failed-distributed-database-resource'), help=u"""Recreate the failed resource for the Globally Distributed Database. \n[Command Reference](recreateFailedDistributedDatabaseResource)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--resource-name', required=True, help=u"""Specify the name of the shard, catalog, or GSM.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def recreate_failed_distributed_database_resource(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, resource_name, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.recreate_failed_distributed_database_resource( + distributed_database_id=distributed_database_id, + resource_name=resource_name, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.rotate_distributed_database_passwords.command_name', 'rotate-distributed-database-passwords'), help=u"""Rotate the gsmuser and gsmcatuser passwords for shards and catalog of the Globally distributed database. This operation will also remove GdsCtlNodes if present. \n[Command Reference](rotateDistributedDatabasePasswords)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--database-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of shard or catalog password rotation details.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'database-details': {'module': 'distributed_database_v26', 'class': 'list[RotateDistributedDatabaseDetails]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'database-details': {'module': 'distributed_database_v26', 'class': 'list[RotateDistributedDatabaseDetails]'}}) +@cli_util.wrap_exceptions +def rotate_distributed_database_passwords(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, database_details, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['databaseDetails'] = cli_util.parse_json_parameter("database_details", database_details) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.rotate_distributed_database_passwords( + distributed_database_id=distributed_database_id, + rotate_distributed_database_passwords_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.scale_distributed_database_gsms.command_name', 'scale-distributed-database-gsms'), help=u"""Scale global service manager(GSM aka shard manager) instances for the Globally distributed database. \n[Command Reference](scaleDistributedDatabaseGsms)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def scale_distributed_database_gsms(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.scale_distributed_database_gsms( + distributed_database_id=distributed_database_id, + scale_distributed_database_gsms_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.start_distributed_database.command_name', 'start'), help=u"""Start the shards, catalog, GSMs and GDSCTL instances of Globally distributed database. \n[Command Reference](startDistributedDatabase)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def start_distributed_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.start_distributed_database( + distributed_database_id=distributed_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.stop_distributed_database.command_name', 'stop'), help=u"""Stop the shards, catalog, GSMs and GDSCTL instances for the Globally distributed database. \n[Command Reference](stopDistributedDatabase)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def stop_distributed_database(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.stop_distributed_database( + distributed_database_id=distributed_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.update_distributed_database.command_name', 'update'), help=u"""Updates the configuration of the Globally distributed database. \n[Command Reference](updateDistributedDatabase)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--display-name', help=u"""Display name of the Globally distributed database.""") +@cli_util.option('--notification-topic-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The collection of [OCID] for the notification topics associated with the globally distributed database. Pass an empty list (`[]`) to remove existing notification topics (set `notificationTopicIds` to empty).""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACTIVE", "FAILED", "NEEDS_ATTENTION", "INACTIVE", "DELETING", "DELETED", "UPDATING", "CREATING"]), multiple=True, help="""This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACTIVE --wait-for-state CREATING would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the resource has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'notification-topic-ids': {'module': 'distributed_database_v26', 'class': 'list[string]'}, 'freeform-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'distributed_database_v26', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'distributed_database_v26', 'class': 'DistributedDatabase'}) +@cli_util.wrap_exceptions +def update_distributed_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, display_name, notification_topic_ids, freeform_tags, defined_tags, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + if not force: + if notification_topic_ids or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to notification-topic-ids and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"): + ctx.abort() + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + + if display_name is not None: + _details['displayName'] = display_name + + if notification_topic_ids is not None: + _details['notificationTopicIds'] = cli_util.parse_json_parameter("notification_topic_ids", notification_topic_ids) + + if freeform_tags is not None: + _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) + + if defined_tags is not None: + _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.update_distributed_database( + distributed_database_id=distributed_database_id, + update_distributed_database_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_distributed_database') and callable(getattr(client, 'get_distributed_database')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + + click.echo('Action completed. Waiting until the resource has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_distributed_database(result.data.id), 'lifecycle_state', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the resource entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for resource to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the resource to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) + + +@distributed_database_group.command(name=cli_util.override('distributed_db_service.validate_distributed_database_network.command_name', 'validate-distributed-database-network'), help=u"""Validate the network connectivity between components of the globally distributed database. \n[Command Reference](validateDistributedDatabaseNetwork)""") +@cli_util.option('--distributed-database-id', required=True, help=u"""Globally distributed database identifier.""") +@cli_util.option('--is-surrogate', type=click.BOOL, help=u"""Determines the surrogates check. Default is true.""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""") +@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def validate_distributed_database_network(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, distributed_database_id, is_surrogate, if_match): + + if isinstance(distributed_database_id, six.string_types) and len(distributed_database_id.strip()) == 0: + raise click.UsageError('Parameter --distributed-database-id cannot be whitespace or empty string') + + kwargs = {} + if is_surrogate is not None: + kwargs['is_surrogate'] = is_surrogate + if if_match is not None: + kwargs['if_match'] = if_match + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_service', ctx) + result = client.validate_distributed_database_network( + distributed_database_id=distributed_database_id, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): + try: + wait_period_kwargs = {} + if max_wait_seconds is not None: + wait_period_kwargs['max_wait_seconds'] = max_wait_seconds + if wait_interval_seconds is not None: + wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds + if 'opc-work-request-id' not in result.headers: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') + cli_util.render_response(result, ctx) + return + + click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) + result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded as e: + # If we fail, we should show an error, but we should still provide the information to the customer + click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + sys.exit(2) + except Exception: + click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) + cli_util.render_response(result, ctx) + raise + else: + click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) + cli_util.render_response(result, ctx) diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/__init__.py b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/client_mappings.py b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/client_mappings.py new file mode 100644 index 000000000..ddfdeb853 --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/client_mappings.py @@ -0,0 +1,14 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +import oci +from oci_cli.cli_clients import CLIENT_MAP +from oci_cli.cli_clients import MODULE_TO_TYPE_MAPPINGS +from oci.distributed_database_v26 import DistributedDbWorkRequestServiceClient + +MODULE_TO_TYPE_MAPPINGS["distributed_database_v26"] = oci.distributed_database_v26.models.distributed_database_v26_type_mapping +if CLIENT_MAP.get("distributed_database_v26") is None: + CLIENT_MAP["distributed_database_v26"] = {} +CLIENT_MAP["distributed_database_v26"]["distributed_db_work_request_service"] = DistributedDbWorkRequestServiceClient diff --git a/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/distributeddbworkrequestservice_cli.py b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/distributeddbworkrequestservice_cli.py new file mode 100644 index 000000000..84405389b --- /dev/null +++ b/services/distributed_database_v26/src/oci_cli_distributed_db_work_request_service/generated/distributeddbworkrequestservice_cli.py @@ -0,0 +1,245 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 + +from __future__ import print_function +import click +import oci # noqa: F401 +import six # noqa: F401 +import sys # noqa: F401 +from oci_cli import cli_constants # noqa: F401 +from oci_cli import cli_util +from oci_cli import json_skeleton_utils +from oci_cli import custom_types # noqa: F401 +from oci_cli.aliasing import CommandGroupWithAlias +from services.distributed_database_v26.src.oci_cli_distributed_database_v26.generated import distributed_database_v26_service_cli + + +@click.command(cli_util.override('distributed_db_work_request_service.distributed_db_work_request_service_root_group.command_name', 'distributed-db-work-request-service'), cls=CommandGroupWithAlias, help=cli_util.override('distributed_db_work_request_service.distributed_db_work_request_service_root_group.help', """Use the Globally Distributed Database service APIs to create and manage the Globally distributed databases."""), short_help=cli_util.override('distributed_db_work_request_service.distributed_db_work_request_service_root_group.short_help', """Globally Distributed Database""")) +@cli_util.help_option_group +def distributed_db_work_request_service_root_group(): + pass + + +@click.command(cli_util.override('distributed_db_work_request_service.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error encountered while executing a work request.""") +@cli_util.help_option_group +def work_request_error_group(): + pass + + +@click.command(cli_util.override('distributed_db_work_request_service.work_request_log_entry_group.command_name', 'work-request-log-entry'), cls=CommandGroupWithAlias, help="""A log message from the execution of a work request.""") +@cli_util.help_option_group +def work_request_log_entry_group(): + pass + + +@click.command(cli_util.override('distributed_db_work_request_service.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""A description of workrequest status""") +@cli_util.help_option_group +def work_request_group(): + pass + + +distributed_database_v26_service_cli.distributed_database_v26_service_group.add_command(distributed_db_work_request_service_root_group) +distributed_db_work_request_service_root_group.add_command(work_request_error_group) +distributed_db_work_request_service_root_group.add_command(work_request_log_entry_group) +distributed_db_work_request_service_root_group.add_command(work_request_group) + + +@work_request_group.command(name=cli_util.override('distributed_db_work_request_service.get_work_request.command_name', 'get'), help=u"""Gets details of the work request with the given ID. \n[Command Reference](getWorkRequest)""") +@cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'WorkRequest'}) +@cli_util.wrap_exceptions +def get_work_request(ctx, from_json, work_request_id): + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_work_request_service', ctx) + result = client.get_work_request( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_error_group.command(name=cli_util.override('distributed_db_work_request_service.list_work_request_errors.command_name', 'list'), help=u"""Returns a (paginated) list of errors for the work request with the given ID. \n[Command Reference](listWorkRequestErrors)""") +@cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""") +@cli_util.option('--page', help=u"""A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""") +@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timestamp"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timestamp is descending.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'WorkRequestErrorCollection'}) +@cli_util.wrap_exceptions +def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + if page is not None: + kwargs['page'] = page + if limit is not None: + kwargs['limit'] = limit + if sort_by is not None: + kwargs['sort_by'] = sort_by + if sort_order is not None: + kwargs['sort_order'] = sort_order + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_work_request_service', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_work_request_errors, + work_request_id=work_request_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_work_request_errors, + limit, + page_size, + work_request_id=work_request_id, + **kwargs + ) + else: + result = client.list_work_request_errors( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_log_entry_group.command(name=cli_util.override('distributed_db_work_request_service.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Returns a (paginated) list of logs for the work request with the given ID. \n[Command Reference](listWorkRequestLogs)""") +@cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""") +@cli_util.option('--page', help=u"""A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""") +@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timestamp"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timestamp is descending.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'WorkRequestLogEntryCollection'}) +@cli_util.wrap_exceptions +def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, page, limit, sort_by, sort_order): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + if page is not None: + kwargs['page'] = page + if limit is not None: + kwargs['limit'] = limit + if sort_by is not None: + kwargs['sort_by'] = sort_by + if sort_order is not None: + kwargs['sort_order'] = sort_order + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_work_request_service', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_work_request_logs, + work_request_id=work_request_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_work_request_logs, + limit, + page_size, + work_request_id=work_request_id, + **kwargs + ) + else: + result = client.list_work_request_logs( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_group.command(name=cli_util.override('distributed_db_work_request_service.list_work_requests.command_name', 'list'), help=u"""Lists the work requests in a compartment. \n[Command Reference](listWorkRequests)""") +@cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""") +@cli_util.option('--work-request-id', help=u"""The ID of the asynchronous work request.""") +@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "NEEDS_ATTENTION"]), help=u"""A filter to return only resources their lifecycleState matches the given OperationStatus.""") +@cli_util.option('--resource-id', help=u"""The ID of the resource affected by the work request.""") +@cli_util.option('--page', help=u"""A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response.""") +@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'ASC' or 'DESC'.""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'distributed_database_v26', 'class': 'WorkRequestSummaryCollection'}) +@cli_util.wrap_exceptions +def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, work_request_id, status, resource_id, page, limit, sort_order, sort_by): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + kwargs = {} + if work_request_id is not None: + kwargs['work_request_id'] = work_request_id + if status is not None: + kwargs['status'] = status + if resource_id is not None: + kwargs['resource_id'] = resource_id + if page is not None: + kwargs['page'] = page + if limit is not None: + kwargs['limit'] = limit + if sort_order is not None: + kwargs['sort_order'] = sort_order + if sort_by is not None: + kwargs['sort_by'] = sort_by + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('distributed_database_v26', 'distributed_db_work_request_service', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_work_requests, + compartment_id=compartment_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_work_requests, + limit, + page_size, + compartment_id=compartment_id, + **kwargs + ) + else: + result = client.list_work_requests( + compartment_id=compartment_id, + **kwargs + ) + cli_util.render_response(result, ctx) diff --git a/services/distributed_database_v26/tests/__init__.py b/services/distributed_database_v26/tests/__init__.py new file mode 100644 index 000000000..7293131c0 --- /dev/null +++ b/services/distributed_database_v26/tests/__init__.py @@ -0,0 +1,4 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. +# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20260101 diff --git a/services/distributed_database_v26/tests/util/generated/command_to_api.py b/services/distributed_database_v26/tests/util/generated/command_to_api.py new file mode 100644 index 000000000..575f45c5b --- /dev/null +++ b/services/distributed_database_v26/tests/util/generated/command_to_api.py @@ -0,0 +1,9 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. + +SDK_client_map = { + "distributed_db_work_request_service.get_work_request": "oci.distributed_database_v26.DistributedDbWorkRequestServiceClient.get_work_request", + "distributed_db_work_request_service.list_work_request_errors": "oci.distributed_database_v26.DistributedDbWorkRequestServiceClient.list_work_request_errors", + "distributed_db_work_request_service.list_work_request_logs": "oci.distributed_database_v26.DistributedDbWorkRequestServiceClient.list_work_request_logs", + "distributed_db_work_request_service.list_work_requests": "oci.distributed_database_v26.DistributedDbWorkRequestServiceClient.list_work_requests", +} diff --git a/services/generative_ai/src/oci_cli_generative_ai/generated/generativeai_cli.py b/services/generative_ai/src/oci_cli_generative_ai/generated/generativeai_cli.py index f583461de..2b00339ac 100644 --- a/services/generative_ai/src/oci_cli_generative_ai/generated/generativeai_cli.py +++ b/services/generative_ai/src/oci_cli_generative_ai/generated/generativeai_cli.py @@ -978,7 +978,7 @@ def create_api_key(ctx, from_json, wait_for_state, max_wait_seconds, wait_interv Allowed values are: - LARGE_COHERE - LARGE_COHERE_V2 - SMALL_COHERE - SMALL_COHERE_V2 - SMALL_COHERE_4 - EMBED_COHERE - LLAMA2_70 - LARGE_GENERIC - LARGE_COHERE_V2_2 - LARGE_GENERIC_4 - SMALL_GENERIC_V2 - LARGE_GENERIC_2 - LARGE_GENERIC_V3 - LARGE_COHERE_V3 - RERANK_COHERE - SMALL_GENERIC_V1 - MEDIUM_GENERIC_V1 - LARGE_GENERIC_V1 - A10_X1 - A10_X2 - A10_X4 - A100_40G_X1 - A100_40G_X2 - A100_40G_X4 - A100_40G_X8 - A100_80G_X1 - A100_80G_X2 - A100_80G_X4 - A100_80G_X8 - H100_X1 - H100_X2 - H100_X4 - H100_X8 - H100_X16 - H100_X32 - H200_X1 - H200_X2 - H200_X4 - H200_X8 -The following shapes can only be used to deploy imported models: - A10_X1, A10_X2, A10_X4 - A100_40G_X1, A100_40G_X2, A100_40G_X4, A100_40G_X8 - A100_80G_X1, A100_80G_X2, A100_80G_X4, A100_80G_X8 - H100_X1, H100_X2, H100_X4, H100_X8 - H100_X16, H100_X32 - H200_X1, H200_X2, H200_X4, H200_X8 - OAI_A10_X2 - OAI_H100_X1 - OAI_H100_X2 - OAI_H200_X1 - OAI_A100_80G_X1 - OAI_A100_80G_X2 - OAI_A100_40G_X1 - OAI_A100_40G_X4 - B200_X1 - B200_X2 - B200_X4 - B200_X8 - OAI_B200_X1 - OAI_B200_X2 - OAI_B200_X4 - OAI_B200_X8 - SB_B200_X1""") +The following shapes can only be used to deploy imported models: - A10_X1, A10_X2, A10_X4 - A100_40G_X1, A100_40G_X2, A100_40G_X4, A100_40G_X8 - A100_80G_X1, A100_80G_X2, A100_80G_X4, A100_80G_X8 - H100_X1, H100_X2, H100_X4, H100_X8 - H100_X16, H100_X32 - H200_X1, H200_X2, H200_X4, H200_X8 - OAI_A10_X2 - OAI_H100_X1 - OAI_H100_X2 - OAI_H200_X1 - OAI_A100_80G_X1 - OAI_A100_80G_X2 - OAI_A100_40G_X1 - OAI_A100_40G_X4 - B200_X1 - B200_X2 - B200_X4 - B200_X8 - OAI_B200_X1 - OAI_B200_X2 - OAI_B200_X4 - OAI_B200_X8 - SB_B200_X1 - COHERE_B300_X1 - META_B300_X1 - OAI_B300_X1""") @cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it's changeable.""") @cli_util.option('--description', help=u"""An optional description of the dedicated AI cluster.""") @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. diff --git a/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py b/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py index f60895a8f..f05ed2386 100644 --- a/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py +++ b/services/object_storage/src/oci_cli_object_storage/generated/objectstorage_cli.py @@ -393,7 +393,9 @@ def copy_object(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_ @cli_util.option('--is-bucket-key-enabled', type=click.BOOL, help=u"""Specifies whether Object Storage should use intermediate cached Bucket Encryption Keys with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. This reduces calls to OCI Vault Key Management Service (KMS). Existing objects are not affected.""") @cli_util.option('--versioning', type=custom_types.CliCaseInsensitiveChoice(["Enabled", "Disabled"]), help=u"""Set the versioning status on the bucket. By default, a bucket is created with versioning `Disabled`. Use this option to enable versioning during bucket creation. Objects in a version enabled bucket are protected from overwrites and deletions. Previous versions of the same object will be available in the bucket.""") @cli_util.option('--auto-tiering', help=u"""Set the auto tiering status on the bucket. By default, a bucket is created with auto tiering `Disabled`. Use this option to enable auto tiering during bucket creation. Objects in a bucket with auto tiering set to `InfrequentAccess` are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects.""") -@cli_util.option('--bucket-scope', help=u"""Scope in which the bucket is unique. Default value is NAMESPACE. Bucket scope as NAMESPACE means that the bucket is unique only in the owning namespace/tenancy. Other tenancies can have a bucket with same name in their namespace. Bucket scope as REGION means that the bucket is regionally unique. No other tenancy can have a bucket with same name and scope REGION.""") +@cli_util.option('--bucket-scope', help=u"""The bucket scope determines weather the bucket name must be unique within the tenancy and region (essentially the namespace) or across all tenancies in the region. The bucket scope also determines if the bucket supports S3 virtual-hosted style URL's or not. + +Allowed values: NAMESPACE: Only supports path-style bucket access, bucket name only needs to be unique within the tenancy and region. REGION: Supports both path-style and virtual-hosted URL style access, bucket name needs to be unique across all tenancies in the region.""") @json_skeleton_utils.get_cli_json_input_option({'metadata': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'object_storage', 'class': 'dict(str, dict(str, object))'}}) @cli_util.help_option @click.pass_context @@ -2267,7 +2269,7 @@ def make_bucket_writable(ctx, from_json, namespace_name, bucket_name): The optional header that defines the base64-encoded SHA384 hash of the body. If the optional opc-content-sha384 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the SHA384 hash for the body and comparing it to the SHA384 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content SHA384 error is returned with the message: \"The computed SHA384 of the request body (ACTUAL_SHA384) does not match the opc-content-sha384 header (HEADER_SHA384)\"""") -@cli_util.option('--content-type', help=u"""The optional Content-Type header that defines the standard MIME type format of the object. Content type defaults to 'application/octet-stream' if not specified in the PutObject call. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and perform special operations on text only objects.""") +@cli_util.option('--content-type', help=u"""The optional Content-Type header that defines the standard MIME type format of the object. Content type defaults to 'application/octet-stream' if not specified in the PutObject call. In the OCI CLI, you can set this value to 'auto' to have the CLI infer the content type from the file name. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and perform special operations on text only objects.""") @cli_util.option('--content-language', help=u"""The optional Content-Language header that defines the content language of the object to upload. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and differentiate objects based on a particular language.""") @cli_util.option('--content-encoding', help=u"""The optional Content-Encoding header that defines the content encodings that were applied to the object to upload. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to determine what decoding mechanisms need to be applied to obtain the media-type specified by the Content-Type header of the object.""") @cli_util.option('--content-disposition', help=u"""The optional Content-Disposition header that defines presentational information for the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to let users download objects with custom filenames in a browser.""") @@ -2623,7 +2625,11 @@ def restore_objects(ctx, from_json, namespace_name, bucket_name, object_name, ho @cli_util.option('--is-bucket-key-enabled', type=click.BOOL, help=u"""Specifies whether Object Storage should use intermediate cached Bucket Encryption Keys with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. This reduces calls to OCI Vault Key Management Service (KMS). Existing objects are not affected.""") @cli_util.option('--versioning', type=custom_types.CliCaseInsensitiveChoice(["Enabled", "Suspended"]), help=u"""The versioning status on the bucket. If in state `Enabled`, multiple versions of the same object can be kept in the bucket. When the object is overwritten or deleted, previous versions will still be available. When versioning is `Suspended`, the previous versions will still remain but new versions will no longer be created when overwitten or deleted. Versioning cannot be disabled on a bucket once enabled.""") @cli_util.option('--auto-tiering', help=u"""The auto tiering status on the bucket. If in state `InfrequentAccess`, objects are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects. When auto tiering is `Disabled`, there will be no automatic transitions between storage tiers.""") -@cli_util.option('--bucket-scope', help=u"""Scope in which the bucket is unique. Default value is NAMESPACE. Bucket scope as NAMESPACE means that the bucket is unique only in the owning namespace/tenancy. Other tenancies can have a bucket with same name in their namespace. Bucket scope as REGION means that the bucket is regionally unique. No other tenancy can have a bucket with same name and scope REGION. BucketScope can only be updated from NAMESPACE to REGION, it cannot be updated from REGION to NAMESPACE. Updating bucket scope is possible only if the bucket name is valid and there is no existing regionally unique bucket with the same name.""") +@cli_util.option('--bucket-scope', help=u"""The bucket scope determines weather the bucket name must be unique within the tenancy and region (essentially the namespace) or across all tenancies in the region. The bucket scope also determines if the bucket supports S3 virtual-hosted style URL's or not. + +Allowed values: NAMESPACE: Only supports path-style bucket access, bucket name only needs to be unique within the tenancy and region. REGION: Supports both path-style and virtual-hosted URL style access, bucket name needs to be unique across all tenancies in the region. + +BucketScope can only be updated from NAMESPACE to REGION, it cannot be updated from REGION to NAMESPACE. Updating bucket scope is possible only if the bucket name is valid and there is no existing regionally unique bucket with the same name.""") @cli_util.option('--if-match', help=u"""The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.""") @json_skeleton_utils.get_cli_json_input_option({'metadata': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'object_storage', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'object_storage', 'class': 'dict(str, dict(str, object))'}}) @cli_util.help_option diff --git a/services/object_storage/src/oci_cli_object_storage/object_storage_transfer_manager/get_object_tasks.py b/services/object_storage/src/oci_cli_object_storage/object_storage_transfer_manager/get_object_tasks.py index b5dae6782..5836587ef 100644 --- a/services/object_storage/src/oci_cli_object_storage/object_storage_transfer_manager/get_object_tasks.py +++ b/services/object_storage/src/oci_cli_object_storage/object_storage_transfer_manager/get_object_tasks.py @@ -33,6 +33,7 @@ def _make_retrying_get_call(object_storage_client, **kwargs): if_none_match=kwargs.get('if_none_match'), range=kwargs.get('range'), opc_client_request_id=kwargs.get('request_id'), + version_id=kwargs.get('version_id'), opc_sse_customer_algorithm=kwargs.get('opc_sse_customer_algorithm'), opc_sse_customer_key=kwargs.get('opc_sse_customer_key'), opc_sse_customer_key_sha256=kwargs.get('opc_sse_customer_key_sha256') @@ -256,6 +257,7 @@ def _make_retrying_head_object_call(self): if_match=self.kwargs.get('if_match'), if_none_match=self.kwargs.get('if_none_match'), opc_client_request_id=self.kwargs.get('request_id'), + version_id=self.kwargs.get('version_id'), opc_sse_customer_algorithm=self.kwargs.get('opc_sse_customer_algorithm'), opc_sse_customer_key=self.kwargs.get('opc_sse_customer_key'), opc_sse_customer_key_sha256=self.kwargs.get('opc_sse_customer_key_sha256') diff --git a/services/object_storage/src/oci_cli_object_storage/objectstorage_cli_extended.py b/services/object_storage/src/oci_cli_object_storage/objectstorage_cli_extended.py index 010f42533..93b54fd9f 100644 --- a/services/object_storage/src/oci_cli_object_storage/objectstorage_cli_extended.py +++ b/services/object_storage/src/oci_cli_object_storage/objectstorage_cli_extended.py @@ -1225,6 +1225,7 @@ def object_get(ctx, from_json, namespace, bucket_name, name, file, version_id, i client = build_client('object_storage', 'object_storage', ctx) head_object = client.head_object(namespace, bucket_name, name, opc_client_request_id=ctx.obj['request_id'], + version_id=version_id, **encryption_key_params) if not head_object: raise click.ClickException('The specified object does not exist') diff --git a/services/object_storage/tests/unit/test_get_object_tasks.py b/services/object_storage/tests/unit/test_get_object_tasks.py new file mode 100644 index 000000000..20a730655 --- /dev/null +++ b/services/object_storage/tests/unit/test_get_object_tasks.py @@ -0,0 +1,77 @@ +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at https://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. + +import six +import mock + +from services.object_storage.src.oci_cli_object_storage.object_storage_transfer_manager.get_object_tasks import ( + GetObjectMultipartTask, + _make_retrying_get_call +) +from services.object_storage.src.oci_cli_object_storage.object_storage_transfer_manager.work_pool_task import ( + WorkPoolTaskCallbacksContainer +) + + +def test_make_retrying_get_call_passes_version_id(): + client = mock.Mock() + + _make_retrying_get_call( + client, + namespace='namespace', + bucket_name='bucket', + object_name='object', + request_id='request-id', + range='bytes=0-10', + version_id='version-id' + ) + + client.get_object.assert_called_once_with( + 'namespace', + 'bucket', + 'object', + if_match=None, + if_none_match=None, + range='bytes=0-10', + opc_client_request_id='request-id', + version_id='version-id', + opc_sse_customer_algorithm=None, + opc_sse_customer_key=None, + opc_sse_customer_key_sha256=None + ) + + +def test_multipart_head_object_call_passes_version_id(): + client = mock.Mock() + request_pool = mock.Mock() + task = GetObjectMultipartTask( + client, + WorkPoolTaskCallbacksContainer(), + request_pool, + six.BytesIO(), + namespace='namespace', + bucket_name='bucket', + object_name='object', + request_id='request-id', + multipart_download_threshold=128, + version_id='version-id' + ) + + task._make_retrying_head_object_call() + + client.head_object.assert_called_once_with( + namespace_name='namespace', + bucket_name='bucket', + object_name='object', + if_match=None, + if_none_match=None, + opc_client_request_id='request-id', + version_id='version-id', + opc_sse_customer_algorithm=None, + opc_sse_customer_key=None, + opc_sse_customer_key_sha256=None + ) diff --git a/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py b/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py index 76d26d6b5..9e84b4023 100644 --- a/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py +++ b/services/resource_manager/src/oci_cli_resource_manager/generated/resourcemanager_cli.py @@ -3254,6 +3254,71 @@ def get_work_request(ctx, from_json, work_request_id): cli_util.render_response(result, ctx) +@work_request_group.command(name=cli_util.override('resource_manager.get_work_request_log_entries.command_name', 'get-work-request-log-entries'), help=u"""Returns console log entries for the specified work request in JSON format. \n[Command Reference](getWorkRequestLogEntries)""") +@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the work request.""") +@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["TERRAFORM_CONSOLE"]), multiple=True, help=u"""A filter that returns only logs of a specified type.""") +@cli_util.option('--level-greater-than-or-equal-to', type=custom_types.CliCaseInsensitiveChoice(["TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"]), help=u"""A filter that returns only log entries that match a given severity level or greater.""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use when sorting returned resources. Ascending (`ASC`) or descending (`DESC`).""") +@cli_util.option('--limit', type=click.INT, help=u"""The number of items returned in a paginated `List` call. For information about pagination, see [List Pagination].""") +@cli_util.option('--page', help=u"""The value of the `opc-next-page` response header from the preceding `List` call. For information about pagination, see [List Pagination].""") +@cli_util.option('--timestamp-greater-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Time stamp specifying the lower time limit for which logs are returned in a query. Format is defined by RFC3339. Example: `2020-01-01T12:00:00.000Z`""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--timestamp-less-than-or-equal-to', type=custom_types.CLI_DATETIME, help=u"""Time stamp specifying the upper time limit for which logs are returned in a query. Format is defined by RFC3339. Example: `2020-02-01T12:00:00.000Z`""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'resource_manager', 'class': 'LogEntryCollection'}) +@cli_util.wrap_exceptions +def get_work_request_log_entries(ctx, from_json, work_request_id, type, level_greater_than_or_equal_to, sort_order, limit, page, timestamp_greater_than_or_equal_to, timestamp_less_than_or_equal_to): + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + if type is not None and len(type) > 0: + kwargs['type'] = type + if level_greater_than_or_equal_to is not None: + kwargs['level_greater_than_or_equal_to'] = level_greater_than_or_equal_to + if sort_order is not None: + kwargs['sort_order'] = sort_order + if limit is not None: + kwargs['limit'] = limit + if page is not None: + kwargs['page'] = page + if timestamp_greater_than_or_equal_to is not None: + kwargs['timestamp_greater_than_or_equal_to'] = timestamp_greater_than_or_equal_to + if timestamp_less_than_or_equal_to is not None: + kwargs['timestamp_less_than_or_equal_to'] = timestamp_less_than_or_equal_to + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('resource_manager', 'resource_manager', ctx) + result = client.get_work_request_log_entries( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_group.command(name=cli_util.override('resource_manager.get_work_request_log_entries_content.command_name', 'get-work-request-log-entries-content'), help=u"""Returns the raw log file for the specified work request in text format. The file includes a maximum of 100,000 log entries. \n[Command Reference](getWorkRequestLogEntriesContent)""") +@cli_util.option('--work-request-id', required=True, help=u"""The [OCID] of the work request.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def get_work_request_log_entries_content(ctx, from_json, work_request_id): + + if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0: + raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('resource_manager', 'resource_manager', ctx) + result = client.get_work_request_log_entries_content( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @configuration_source_provider_summary_group.command(name=cli_util.override('resource_manager.list_configuration_source_providers.command_name', 'list-configuration-source-providers'), help=u"""Lists configuration source providers according to the specified filter. For more information, see [Listing Configuration Source Providers]. - For `compartmentId`, lists all configuration source providers in the matching compartment. - For `configurationSourceProviderId`, lists the matching configuration source provider. \n[Command Reference](listConfigurationSourceProviders)""") @cli_util.option('--compartment-id', help=u"""A filter to return only resources that exist in the compartment, identified by [OCID].""") @cli_util.option('--configuration-source-provider-id', help=u"""A filter to return only configuration source providers that match the provided [OCID].""") diff --git a/services/resource_manager/tests/util/generated/command_to_api.py b/services/resource_manager/tests/util/generated/command_to_api.py index 77eeddc54..31f1e119d 100644 --- a/services/resource_manager/tests/util/generated/command_to_api.py +++ b/services/resource_manager/tests/util/generated/command_to_api.py @@ -34,6 +34,8 @@ "resource_manager.get_template_logo": "oci.resource_manager.ResourceManagerClient.get_template_logo", "resource_manager.get_template_tf_config": "oci.resource_manager.ResourceManagerClient.get_template_tf_config", "resource_manager.get_work_request": "oci.resource_manager.ResourceManagerClient.get_work_request", + "resource_manager.get_work_request_log_entries": "oci.resource_manager.ResourceManagerClient.get_work_request_log_entries", + "resource_manager.get_work_request_log_entries_content": "oci.resource_manager.ResourceManagerClient.get_work_request_log_entries_content", "resource_manager.list_configuration_source_providers": "oci.resource_manager.ResourceManagerClient.list_configuration_source_providers", "resource_manager.list_job_associated_resources": "oci.resource_manager.ResourceManagerClient.list_job_associated_resources", "resource_manager.list_job_outputs": "oci.resource_manager.ResourceManagerClient.list_job_outputs", diff --git a/services/resource_scheduler/src/oci_cli_schedule/generated/schedule_cli.py b/services/resource_scheduler/src/oci_cli_schedule/generated/schedule_cli.py index cd8ced8ae..c29b37d6c 100644 --- a/services/resource_scheduler/src/oci_cli_schedule/generated/schedule_cli.py +++ b/services/resource_scheduler/src/oci_cli_schedule/generated/schedule_cli.py @@ -218,6 +218,7 @@ def change_schedule_compartment(ctx, from_json, wait_for_state, max_wait_seconds @cli_util.option('--time-ends', type=custom_types.CLI_DATETIME, help=u"""This is the date and time the schedule ends, in the format defined by [RFC 3339] Example: `2016-08-25T21:10:29.600Z`""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--local-time-zone', help=u"""IANA timezone identifier (e.g., 'America/New_York', 'UTC', 'Europe/London'). This determines the timezone context for evaluating the recurrence expression.""") @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""These are free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @@ -232,7 +233,7 @@ def change_schedule_compartment(ctx, from_json, wait_for_state, max_wait_seconds @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'resource-filters': {'module': 'resource_scheduler', 'class': 'list[ResourceFilter]'}, 'resources': {'module': 'resource_scheduler', 'class': 'list[Resource]'}, 'freeform-tags': {'module': 'resource_scheduler', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'resource_scheduler', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'resource_scheduler', 'class': 'Schedule'}) @cli_util.wrap_exceptions -def create_schedule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, action, recurrence_details, recurrence_type, display_name, description, resource_filters, resources, time_starts, time_ends, freeform_tags, defined_tags): +def create_schedule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, action, recurrence_details, recurrence_type, display_name, description, resource_filters, resources, time_starts, time_ends, local_time_zone, freeform_tags, defined_tags): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -261,6 +262,9 @@ def create_schedule(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter if time_ends is not None: _details['timeEnds'] = time_ends + if local_time_zone is not None: + _details['localTimeZone'] = local_time_zone + if freeform_tags is not None: _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) @@ -774,6 +778,7 @@ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, wor @cli_util.option('--time-ends', type=custom_types.CLI_DATETIME, help=u"""This is the date and time the schedule ends, in the format defined by [RFC 3339] Example: `2016-08-25T21:10:29.600Z`""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--local-time-zone', help=u"""IANA timezone identifier (e.g., 'America/New_York', 'UTC', 'Europe/London'). This determines the timezone context for evaluating the recurrence expression.""") @cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""These are free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags]. Example: `{\"Department\": \"Finance\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @@ -790,7 +795,7 @@ def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, wor @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'resource-filters': {'module': 'resource_scheduler', 'class': 'list[ResourceFilter]'}, 'resources': {'module': 'resource_scheduler', 'class': 'list[Resource]'}, 'freeform-tags': {'module': 'resource_scheduler', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'resource_scheduler', 'class': 'dict(str, dict(str, object))'}}) @cli_util.wrap_exceptions -def update_schedule(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, schedule_id, display_name, description, action, recurrence_details, recurrence_type, resource_filters, resources, time_starts, time_ends, freeform_tags, defined_tags, if_match): +def update_schedule(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, schedule_id, display_name, description, action, recurrence_details, recurrence_type, resource_filters, resources, time_starts, time_ends, local_time_zone, freeform_tags, defined_tags, if_match): if isinstance(schedule_id, six.string_types) and len(schedule_id.strip()) == 0: raise click.UsageError('Parameter --schedule-id cannot be whitespace or empty string') @@ -833,6 +838,9 @@ def update_schedule(ctx, from_json, force, wait_for_state, max_wait_seconds, wai if time_ends is not None: _details['timeEnds'] = time_ends + if local_time_zone is not None: + _details['localTimeZone'] = local_time_zone + if freeform_tags is not None: _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) diff --git a/setup.py b/setup.py index 4f96025f1..c65436227 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def open_relative(*path): readme = f.read() requires = [ - 'oci==2.184.0', + 'oci==2.184.1', 'arrow>=1.0.0,<2.0.0', 'certifi>=2025.1.31,<2026.0.0', 'click>=8.0.4,<=8.1.2; python_version < "3.11"', diff --git a/src/oci_cli/service_mapping.py b/src/oci_cli/service_mapping.py index e01288cf4..766cf1c1f 100644 --- a/src/oci_cli/service_mapping.py +++ b/src/oci_cli/service_mapping.py @@ -278,6 +278,11 @@ "Database Tools Runtime", "Others" ], + "ddfs": [ + "ddfs", + "Device Data FHIR Service", + "Others" + ], "delegate-access-control": [ "delegate_access_control", "Oracle Delegate Access Control", @@ -313,6 +318,11 @@ "Globally Distributed Database", "Others" ], + "distributed-database-v26": [ + "distributed_database_v26", + "Globally Distributed Database", + "Others" + ], "dns": [ "dns", "DNS", @@ -549,7 +559,7 @@ "Others" ], "multicloud": [ - "multicloud", + "omhub_cp", "Oracle Multicloud", "Others" ], @@ -579,7 +589,7 @@ "Databases" ], "occ": [ - "oci_control_center", + "occ", "OCI Control Center", "Others" ], diff --git a/src/oci_cli/version.py b/src/oci_cli/version.py index c57ce8995..1f531c65a 100644 --- a/src/oci_cli/version.py +++ b/src/oci_cli/version.py @@ -2,4 +2,4 @@ # Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. -__version__ = '3.90.1' +__version__ = '3.90.2'