diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e52eb6aed..854168c03 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,65 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `__. +3.92.0 - 2026-09-01 +------------------- +Added +~~~~~ +* Cluster Health service + + * Support for diagnosis store management and diagnosis request/query commands + + * ``oci cluster-health diagnosis-store`` + * ``oci cluster-health diagnosis-results request-diagnosis`` + * ``oci cluster-health diagnosis-summary-collection query-diagnosis-summary`` + * ``oci cluster-health recommendation-report query-diagnosis-by-health-check-key`` + * ``oci cluster-health work-request`` + +* Database service + + * Support for listing available maintenance windows for Autonomous AI Databases + + * ``oci db autonomous-database list-available-maintenance-windows`` + + * Support for new optional parameters ``--scheduled-maintenance-window`` and ``--time-scheduled-maintenance-window-update`` + + * ``oci db autonomous-database update --scheduled-maintenance-window --time-scheduled-maintenance-window-update`` + + * Support for new optional parameter ``--compartment-id`` + + * ``oci db system list-db-system-compute-performances --compartment-id`` + +* Internet of Things service + + * Support for new optional parameter ``--connectivity-type`` + + * ``oci iot digital-twin-instance update --connectivity-type`` + + * Support for managing flow runtimes for building and running Node-RED flows + + * ``oci iot flow-runtime`` + +Changed +~~~~~~~ +* Database service + + * ``--ssh-public-keys`` is now an optional parameter + + * ``oci db system launch`` + * ``oci db system launch-db-system-launch-standby-db-system-details`` + * ``oci db system launch-from-database`` + * ``oci db system launch-from-db-system`` + * ``oci db system launch-from-backup`` + + * [BREAKING] Removal of deprecated commands for updating ADB key details + + * ``oci db autonomous-database update-autonomous-database-aws-key-details`` + * ``oci db autonomous-database update-autonomous-database-azure-key-details`` + * ``oci db autonomous-database update-autonomous-database-gcp-key-details`` + * ``oci db autonomous-database update-autonomous-database-oci-key-details`` + * ``oci db autonomous-database update-autonomous-database-okv-key-details`` + * ``oci db autonomous-database update-autonomous-database-oracle-managed-key-details`` + 3.91.0 - 2026-08-25 ------------------- Added diff --git a/requirements.txt b/requirements.txt index 1c8f93acf..1fdd5291b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ # you may need to use the --extra-index-url option instead. appdirs==1.4.3 +aiohttp<3.13.0 arrow>=1.0.0,<2.0.0 certifi>=2025.1.31,<2026.0.0 cffi>=1.9.1,<=2.0.0 @@ -19,7 +20,7 @@ jmespath>=0.10.0,<=1.0.1 importlib-metadata; python_version < '3.8' ndg-httpsclient==0.4.2 mock==2.0.0 -oci==2.185.0 +oci==2.185.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/cluster_health/__init__.py b/services/cluster_health/__init__.py new file mode 100644 index 000000000..2cea71831 --- /dev/null +++ b/services/cluster_health/__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: 20260331 diff --git a/services/cluster_health/src/__init__.py b/services/cluster_health/src/__init__.py new file mode 100644 index 000000000..2cea71831 --- /dev/null +++ b/services/cluster_health/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: 20260331 diff --git a/services/cluster_health/src/oci_cli_diagnosis/__init__.py b/services/cluster_health/src/oci_cli_diagnosis/__init__.py new file mode 100644 index 000000000..2cea71831 --- /dev/null +++ b/services/cluster_health/src/oci_cli_diagnosis/__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: 20260331 diff --git a/services/cluster_health/src/oci_cli_diagnosis/generated/__init__.py b/services/cluster_health/src/oci_cli_diagnosis/generated/__init__.py new file mode 100644 index 000000000..2cea71831 --- /dev/null +++ b/services/cluster_health/src/oci_cli_diagnosis/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: 20260331 diff --git a/services/cluster_health/src/oci_cli_diagnosis/generated/client_mappings.py b/services/cluster_health/src/oci_cli_diagnosis/generated/client_mappings.py new file mode 100644 index 000000000..ec4def44e --- /dev/null +++ b/services/cluster_health/src/oci_cli_diagnosis/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: 20260331 + +import oci +from oci_cli.cli_clients import CLIENT_MAP +from oci_cli.cli_clients import MODULE_TO_TYPE_MAPPINGS +from oci.cluster_health import DiagnosisClient + +MODULE_TO_TYPE_MAPPINGS["cluster_health"] = oci.cluster_health.models.cluster_health_type_mapping +if CLIENT_MAP.get("cluster_health") is None: + CLIENT_MAP["cluster_health"] = {} +CLIENT_MAP["cluster_health"]["diagnosis"] = DiagnosisClient diff --git a/services/cluster_health/src/oci_cli_diagnosis/generated/diagnosis_cli.py b/services/cluster_health/src/oci_cli_diagnosis/generated/diagnosis_cli.py new file mode 100644 index 000000000..27767f626 --- /dev/null +++ b/services/cluster_health/src/oci_cli_diagnosis/generated/diagnosis_cli.py @@ -0,0 +1,767 @@ +# 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: 20260331 + +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('cluster_health.cluster_health_root_group.command_name', 'cluster-health'), cls=CommandGroupWithAlias, help=cli_util.override('cluster_health.cluster_health_root_group.help', """Use the ITV Control Plane Diagnosis Store API to manage diagnosis."""), short_help=cli_util.override('cluster_health.cluster_health_root_group.short_help', """ITV Control Plane - Diagnosis Store API""")) +@cli_util.help_option_group +def cluster_health_root_group(): + pass + + +@click.command(cli_util.override('cluster_health.diagnosis_store_group.command_name', 'diagnosis-store'), cls=CommandGroupWithAlias, help="""A DiagnosisStore is a description of a DiagnosisStore. + +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 diagnosis_store_group(): + pass + + +@click.command(cli_util.override('cluster_health.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('cluster_health.recommendation_report_group.command_name', 'recommendation-report'), cls=CommandGroupWithAlias, help="""A recommendation report""") +@cli_util.help_option_group +def recommendation_report_group(): + pass + + +@click.command(cli_util.override('cluster_health.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('cluster_health.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 + + +@click.command(cli_util.override('cluster_health.diagnosis_summary_collection_group.command_name', 'diagnosis-summary-collection'), cls=CommandGroupWithAlias, help="""a list of Diagnosis Summaries.""") +@cli_util.help_option_group +def diagnosis_summary_collection_group(): + pass + + +@click.command(cli_util.override('cluster_health.diagnosis_results_group.command_name', 'diagnosis-results'), cls=CommandGroupWithAlias, help="""the results of requestDiagnosis""") +@cli_util.help_option_group +def diagnosis_results_group(): + pass + + +cluster_health_root_group.add_command(diagnosis_store_group) +cluster_health_root_group.add_command(work_request_error_group) +cluster_health_root_group.add_command(recommendation_report_group) +cluster_health_root_group.add_command(work_request_log_entry_group) +cluster_health_root_group.add_command(work_request_group) +cluster_health_root_group.add_command(diagnosis_summary_collection_group) +cluster_health_root_group.add_command(diagnosis_results_group) + + +@work_request_group.command(name=cli_util.override('cluster_health.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('cluster_health', 'diagnosis', ctx) + result = client.cancel_work_request( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@diagnosis_store_group.command(name=cli_util.override('cluster_health.change_diagnosis_store_compartment.command_name', 'change-compartment'), help=u"""Moves a Diagnosis 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](changeDiagnosisStoreCompartment)""") +@cli_util.option('--diagnosis-store-id', required=True, help=u"""The [OCID] of the Diagnosis.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to move the Diagnosis 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", "CANCELING", "CANCELED"]), 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 CANCELED 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_diagnosis_store_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, diagnosis_store_id, compartment_id, if_match): + + if isinstance(diagnosis_store_id, six.string_types) and len(diagnosis_store_id.strip()) == 0: + raise click.UsageError('Parameter --diagnosis-store-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('cluster_health', 'diagnosis', ctx) + result = client.change_diagnosis_store_compartment( + diagnosis_store_id=diagnosis_store_id, + change_diagnosis_store_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) + + +@diagnosis_store_group.command(name=cli_util.override('cluster_health.create_diagnosis_store.command_name', 'create'), help=u"""Creates a Diagnosis Store. \n[Command Reference](createDiagnosisStore)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to create the Diagnosis 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('--object-store-namespace', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") +@cli_util.option('--object-store-bucket', 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", "CANCELING", "CANCELED"]), 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 CANCELED 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': 'cluster_health', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'cluster_health', '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': 'cluster_health', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'cluster_health', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'cluster_health', 'class': 'DiagnosisStore'}) +@cli_util.wrap_exceptions +def create_diagnosis_store(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, object_store_namespace, object_store_bucket, 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 + + if display_name is not None: + _details['displayName'] = display_name + + if object_store_namespace is not None: + _details['objectStoreNamespace'] = object_store_namespace + + if object_store_bucket is not None: + _details['objectStoreBucket'] = object_store_bucket + + 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('cluster_health', 'diagnosis', ctx) + result = client.create_diagnosis_store( + create_diagnosis_store_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) + + +@diagnosis_store_group.command(name=cli_util.override('cluster_health.delete_diagnosis_store.command_name', 'delete'), help=u"""Deletes a Diagnosis Store. \n[Command Reference](deleteDiagnosisStore)""") +@cli_util.option('--diagnosis-store-id', required=True, help=u"""The [OCID] of the Diagnosis.""") +@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", "CANCELING", "CANCELED"]), 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 CANCELED 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_diagnosis_store(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, diagnosis_store_id, if_match): + + if isinstance(diagnosis_store_id, six.string_types) and len(diagnosis_store_id.strip()) == 0: + raise click.UsageError('Parameter --diagnosis-store-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('cluster_health', 'diagnosis', ctx) + result = client.delete_diagnosis_store( + diagnosis_store_id=diagnosis_store_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) + + +@diagnosis_store_group.command(name=cli_util.override('cluster_health.get_diagnosis_store.command_name', 'get'), help=u"""Gets information about a Diagnosis Store. \n[Command Reference](getDiagnosisStore)""") +@cli_util.option('--diagnosis-store-id', required=True, help=u"""The [OCID] of the Diagnosis.""") +@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': 'cluster_health', 'class': 'DiagnosisStore'}) +@cli_util.wrap_exceptions +def get_diagnosis_store(ctx, from_json, diagnosis_store_id): + + if isinstance(diagnosis_store_id, six.string_types) and len(diagnosis_store_id.strip()) == 0: + raise click.UsageError('Parameter --diagnosis-store-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('cluster_health', 'diagnosis', ctx) + result = client.get_diagnosis_store( + diagnosis_store_id=diagnosis_store_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_group.command(name=cli_util.override('cluster_health.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': 'cluster_health', '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('cluster_health', 'diagnosis', ctx) + result = client.get_work_request( + work_request_id=work_request_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@diagnosis_store_group.command(name=cli_util.override('cluster_health.list_diagnosis_stores.command_name', 'list'), help=u"""Gets a list of Diagnosis Stores. \n[Command Reference](listDiagnosisStores)""") +@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('--diagnosis-store-id', help=u"""The [OCID] of the Diagnosis.""") +@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': 'cluster_health', 'class': 'DiagnosisStoreCollection'}) +@cli_util.wrap_exceptions +def list_diagnosis_stores(ctx, from_json, all_pages, page_size, compartment_id, lifecycle_state, display_name, diagnosis_store_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 diagnosis_store_id is not None: + kwargs['diagnosis_store_id'] = diagnosis_store_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('cluster_health', 'diagnosis', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_diagnosis_stores, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_diagnosis_stores, + limit, + page_size, + **kwargs + ) + else: + result = client.list_diagnosis_stores( + **kwargs + ) + cli_util.render_response(result, ctx) + + +@work_request_error_group.command(name=cli_util.override('cluster_health.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(["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 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': 'cluster_health', '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('cluster_health', 'diagnosis', 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('cluster_health.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(["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 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': 'cluster_health', '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('cluster_health', 'diagnosis', 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('cluster_health.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", "CANCELING", "CANCELED"]), help=u"""A filter to return only the resources that match the given lifecycle state.""") +@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': 'cluster_health', '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('cluster_health', 'diagnosis', 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) + + +@recommendation_report_group.command(name=cli_util.override('cluster_health.query_diagnosis_by_health_check_key.command_name', 'query-diagnosis-by-health-check-key'), help=u"""Query latest diagnosis result summaries. \n[Command Reference](queryDiagnosisByHealthCheckKey)""") +@cli_util.option('--diagnosis-store-id', required=True, help=u"""The [OCID] of the Diagnosis.""") +@cli_util.option('--health-check-key', required=True, help=u"""Identifier of the health check""") +@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': 'cluster_health', 'class': 'RecommendationReport'}) +@cli_util.wrap_exceptions +def query_diagnosis_by_health_check_key(ctx, from_json, diagnosis_store_id, health_check_key): + + if isinstance(diagnosis_store_id, six.string_types) and len(diagnosis_store_id.strip()) == 0: + raise click.UsageError('Parameter --diagnosis-store-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['healthCheckKey'] = health_check_key + + client = cli_util.build_client('cluster_health', 'diagnosis', ctx) + result = client.query_diagnosis_by_health_check_key( + diagnosis_store_id=diagnosis_store_id, + query_diagnosis_by_health_check_key_details=_details, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@diagnosis_summary_collection_group.command(name=cli_util.override('cluster_health.query_diagnosis_summary.command_name', 'query-diagnosis-summary'), help=u"""Query latest diagnosis result summaries. \n[Command Reference](queryDiagnosisSummary)""") +@cli_util.option('--diagnosis-store-id', required=True, help=u"""The [OCID] of the Diagnosis.""") +@cli_util.option('--instance-ids', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of instance OCIDs to match.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--test-type', type=custom_types.CliCaseInsensitiveChoice(["PASSIVE", "ACTIVE"]), help=u"""The test type, PASSIVE or ACTIVE""") +@cli_util.option('--time-test-run-interval-start', type=custom_types.CLI_DATETIME, help=u"""Start of the time range for tests run, in RFC 3339 format.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--time-test-run-interval-end', type=custom_types.CLI_DATETIME, help=u"""End of the time range for tests run, in RFC 3339 format.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@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].""") +@json_skeleton_utils.get_cli_json_input_option({'instance-ids': {'module': 'cluster_health', 'class': 'list[string]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'instance-ids': {'module': 'cluster_health', 'class': 'list[string]'}}, output_type={'module': 'cluster_health', 'class': 'DiagnosisSummaryCollection'}) +@cli_util.wrap_exceptions +def query_diagnosis_summary(ctx, from_json, diagnosis_store_id, instance_ids, test_type, time_test_run_interval_start, time_test_run_interval_end, limit, page): + + if isinstance(diagnosis_store_id, six.string_types) and len(diagnosis_store_id.strip()) == 0: + raise click.UsageError('Parameter --diagnosis-store-id cannot be whitespace or empty string') + + kwargs = {} + if limit is not None: + kwargs['limit'] = limit + if page is not None: + kwargs['page'] = page + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['instanceIds'] = cli_util.parse_json_parameter("instance_ids", instance_ids) + + if test_type is not None: + _details['testType'] = test_type + + if time_test_run_interval_start is not None: + _details['timeTestRunIntervalStart'] = time_test_run_interval_start + + if time_test_run_interval_end is not None: + _details['timeTestRunIntervalEnd'] = time_test_run_interval_end + + client = cli_util.build_client('cluster_health', 'diagnosis', ctx) + result = client.query_diagnosis_summary( + diagnosis_store_id=diagnosis_store_id, + query_diagnosis_summary_details=_details, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@diagnosis_results_group.command(name=cli_util.override('cluster_health.request_diagnosis.command_name', 'request-diagnosis'), help=u"""Request a diagnosis to be analyzed. \n[Command Reference](requestDiagnosis)""") +@cli_util.option('--diagnosis-store-id', required=True, help=u"""The [OCID] of the Diagnosis.""") +@cli_util.option('--health-check-keys', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of health check IDs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@json_skeleton_utils.get_cli_json_input_option({'health-check-keys': {'module': 'cluster_health', 'class': 'list[string]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'health-check-keys': {'module': 'cluster_health', 'class': 'list[string]'}}, output_type={'module': 'cluster_health', 'class': 'DiagnosisResults'}) +@cli_util.wrap_exceptions +def request_diagnosis(ctx, from_json, diagnosis_store_id, health_check_keys): + + if isinstance(diagnosis_store_id, six.string_types) and len(diagnosis_store_id.strip()) == 0: + raise click.UsageError('Parameter --diagnosis-store-id cannot be whitespace or empty string') + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['healthCheckKeys'] = cli_util.parse_json_parameter("health_check_keys", health_check_keys) + + client = cli_util.build_client('cluster_health', 'diagnosis', ctx) + result = client.request_diagnosis( + diagnosis_store_id=diagnosis_store_id, + request_diagnosis_details=_details, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@diagnosis_store_group.command(name=cli_util.override('cluster_health.update_diagnosis_store.command_name', 'update'), help=u"""Updates a Diagnosis Store. \n[Command Reference](updateDiagnosisStore)""") +@cli_util.option('--diagnosis-store-id', required=True, help=u"""The [OCID] of the Diagnosis.""") +@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('--object-store-namespace', help=u"""A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.""") +@cli_util.option('--object-store-bucket', 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", "CANCELING", "CANCELED"]), 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 CANCELED 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': 'cluster_health', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'cluster_health', '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': 'cluster_health', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'cluster_health', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.wrap_exceptions +def update_diagnosis_store(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, diagnosis_store_id, display_name, object_store_namespace, object_store_bucket, freeform_tags, defined_tags, if_match): + + if isinstance(diagnosis_store_id, six.string_types) and len(diagnosis_store_id.strip()) == 0: + raise click.UsageError('Parameter --diagnosis-store-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 object_store_namespace is not None: + _details['objectStoreNamespace'] = object_store_namespace + + if object_store_bucket is not None: + _details['objectStoreBucket'] = object_store_bucket + + 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('cluster_health', 'diagnosis', ctx) + result = client.update_diagnosis_store( + diagnosis_store_id=diagnosis_store_id, + update_diagnosis_store_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/cluster_health/tests/__init__.py b/services/cluster_health/tests/__init__.py new file mode 100644 index 000000000..2cea71831 --- /dev/null +++ b/services/cluster_health/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: 20260331 diff --git a/services/cluster_health/tests/util/generated/command_to_api.py b/services/cluster_health/tests/util/generated/command_to_api.py new file mode 100644 index 000000000..8eef15578 --- /dev/null +++ b/services/cluster_health/tests/util/generated/command_to_api.py @@ -0,0 +1,19 @@ +# coding: utf-8 +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. + +SDK_client_map = { + "cluster_health.cancel_work_request": "oci.cluster_health.DiagnosisClient.cancel_work_request", + "cluster_health.change_diagnosis_store_compartment": "oci.cluster_health.DiagnosisClient.change_diagnosis_store_compartment", + "cluster_health.create_diagnosis_store": "oci.cluster_health.DiagnosisClient.create_diagnosis_store", + "cluster_health.delete_diagnosis_store": "oci.cluster_health.DiagnosisClient.delete_diagnosis_store", + "cluster_health.get_diagnosis_store": "oci.cluster_health.DiagnosisClient.get_diagnosis_store", + "cluster_health.get_work_request": "oci.cluster_health.DiagnosisClient.get_work_request", + "cluster_health.list_diagnosis_stores": "oci.cluster_health.DiagnosisClient.list_diagnosis_stores", + "cluster_health.list_work_request_errors": "oci.cluster_health.DiagnosisClient.list_work_request_errors", + "cluster_health.list_work_request_logs": "oci.cluster_health.DiagnosisClient.list_work_request_logs", + "cluster_health.list_work_requests": "oci.cluster_health.DiagnosisClient.list_work_requests", + "cluster_health.query_diagnosis_by_health_check_key": "oci.cluster_health.DiagnosisClient.query_diagnosis_by_health_check_key", + "cluster_health.query_diagnosis_summary": "oci.cluster_health.DiagnosisClient.query_diagnosis_summary", + "cluster_health.request_diagnosis": "oci.cluster_health.DiagnosisClient.request_diagnosis", + "cluster_health.update_diagnosis_store": "oci.cluster_health.DiagnosisClient.update_diagnosis_store", +} 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 c1e971fd8..640df6cb2 100644 --- a/services/database/src/oci_cli_database/generated/database_cli.py +++ b/services/database/src/oci_cli_database/generated/database_cli.py @@ -24438,7 +24438,6 @@ def launch_autonomous_exadata_infrastructure(ctx, from_json, wait_for_state, max @cli_util.option('--shape', required=True, help=u"""The shape of the DB system. The shape determines resources allocated to the DB system. - For virtual machine shapes, the number of CPU cores and memory - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage To get a list of shapes, use the [ListDbSystemShapes] operation.""") -@cli_util.option('--ssh-public-keys', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--hostname', required=True, help=u"""The hostname for the DB system. The hostname must begin with an alphabetic character, and can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. The maximum length of the combined hostname and domain is 63 characters. @@ -24463,6 +24462,7 @@ def launch_autonomous_exadata_infrastructure(ctx, from_json, wait_for_state, max @cli_util.option('--db-system-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--storage-volume-performance-mode', type=custom_types.CliCaseInsensitiveChoice(["BALANCED", "HIGH_PERFORMANCE"]), help=u"""The block storage volume performance level. Valid values are `BALANCED` and `HIGH_PERFORMANCE`. See [Block Volume Performance] for more information.""") @cli_util.option('--sparse-diskgroup', type=click.BOOL, help=u"""If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured.""") +@cli_util.option('--ssh-public-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--domain', help=u"""A domain name used for the DB system. If the Oracle-provided Internet and VCN Resolver is enabled for the specified subnet, the domain name for the subnet is used (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted.""") @cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPU cores to enable for a bare metal or Exadata DB system or AMD VMDB Systems. The valid values depend on the specified shape: @@ -24497,7 +24497,7 @@ def launch_autonomous_exadata_infrastructure(ctx, from_json, wait_for_state, max @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'fault-domains': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'backup-network-nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'db-system-options': {'module': 'database', 'class': 'DbSystemOptions'}, 'ssh-public-keys': {'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))'}, 'data-collection-options': {'module': 'database', 'class': 'DataCollectionOptions'}}, output_type={'module': 'database', 'class': 'DbSystem'}) @cli_util.wrap_exceptions -def launch_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, ssh_public_keys, hostname, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, source, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, opc_dry_run): +def launch_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, hostname, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, ssh_public_keys, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, source, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -24508,7 +24508,6 @@ def launch_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte _details['availabilityDomain'] = availability_domain _details['subnetId'] = subnet_id _details['shape'] = shape - _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) _details['hostname'] = hostname if fault_domains is not None: @@ -24538,6 +24537,9 @@ def launch_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte if sparse_diskgroup is not None: _details['sparseDiskgroup'] = sparse_diskgroup + if ssh_public_keys is not None: + _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) + if domain is not None: _details['domain'] = domain @@ -24645,7 +24647,6 @@ def launch_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte @cli_util.option('--shape', required=True, help=u"""The shape of the DB system. The shape determines resources allocated to the DB system. - For virtual machine shapes, the number of CPU cores and memory - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage To get a list of shapes, use the [ListDbSystemShapes] operation.""") -@cli_util.option('--ssh-public-keys', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--hostname', required=True, help=u"""The hostname for the DB system. The hostname must begin with an alphabetic character, and can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. The maximum length of the combined hostname and domain is 63 characters. @@ -24672,6 +24673,7 @@ def launch_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte @cli_util.option('--db-system-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--storage-volume-performance-mode', type=custom_types.CliCaseInsensitiveChoice(["BALANCED", "HIGH_PERFORMANCE"]), help=u"""The block storage volume performance level. Valid values are `BALANCED` and `HIGH_PERFORMANCE`. See [Block Volume Performance] for more information.""") @cli_util.option('--sparse-diskgroup', type=click.BOOL, help=u"""If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured.""") +@cli_util.option('--ssh-public-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--domain', help=u"""A domain name used for the DB system. If the Oracle-provided Internet and VCN Resolver is enabled for the specified subnet, the domain name for the subnet is used (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted.""") @cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPU cores to enable for a bare metal or Exadata DB system or AMD VMDB Systems. The valid values depend on the specified shape: @@ -24708,7 +24710,7 @@ def launch_db_system(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'fault-domains': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'backup-network-nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'db-system-options': {'module': 'database', 'class': 'DbSystemOptions'}, 'ssh-public-keys': {'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))'}, 'data-collection-options': {'module': 'database', 'class': 'DataCollectionOptions'}, 'db-home': {'module': 'database', 'class': 'CreateDbHomeDetails'}, 'maintenance-window-details': {'module': 'database', 'class': 'MaintenanceWindow'}}, output_type={'module': 'database', 'class': 'DbSystem'}) @cli_util.wrap_exceptions -def launch_db_system_launch_db_system_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, ssh_public_keys, hostname, db_home, database_edition, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, disk_redundancy, license_model, maintenance_window_details, opc_dry_run): +def launch_db_system_launch_db_system_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, hostname, db_home, database_edition, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, ssh_public_keys, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, disk_redundancy, license_model, maintenance_window_details, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -24719,7 +24721,6 @@ def launch_db_system_launch_db_system_details(ctx, from_json, wait_for_state, ma _details['availabilityDomain'] = availability_domain _details['subnetId'] = subnet_id _details['shape'] = shape - _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) _details['hostname'] = hostname _details['dbHome'] = cli_util.parse_json_parameter("db_home", db_home) _details['databaseEdition'] = database_edition @@ -24751,6 +24752,9 @@ def launch_db_system_launch_db_system_details(ctx, from_json, wait_for_state, ma if sparse_diskgroup is not None: _details['sparseDiskgroup'] = sparse_diskgroup + if ssh_public_keys is not None: + _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) + if domain is not None: _details['domain'] = domain @@ -24866,7 +24870,6 @@ def launch_db_system_launch_db_system_details(ctx, from_json, wait_for_state, ma @cli_util.option('--shape', required=True, help=u"""The shape of the DB system. The shape determines resources allocated to the DB system. - For virtual machine shapes, the number of CPU cores and memory - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage To get a list of shapes, use the [ListDbSystemShapes] operation.""") -@cli_util.option('--ssh-public-keys', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--hostname', required=True, help=u"""The hostname for the DB system. The hostname must begin with an alphabetic character, and can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. The maximum length of the combined hostname and domain is 63 characters. @@ -24893,6 +24896,7 @@ def launch_db_system_launch_db_system_details(ctx, from_json, wait_for_state, ma @cli_util.option('--db-system-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--storage-volume-performance-mode', type=custom_types.CliCaseInsensitiveChoice(["BALANCED", "HIGH_PERFORMANCE"]), help=u"""The block storage volume performance level. Valid values are `BALANCED` and `HIGH_PERFORMANCE`. See [Block Volume Performance] for more information.""") @cli_util.option('--sparse-diskgroup', type=click.BOOL, help=u"""If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured.""") +@cli_util.option('--ssh-public-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--domain', help=u"""A domain name used for the DB system. If the Oracle-provided Internet and VCN Resolver is enabled for the specified subnet, the domain name for the subnet is used (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted.""") @cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPU cores to enable for a bare metal or Exadata DB system or AMD VMDB Systems. The valid values depend on the specified shape: @@ -24927,7 +24931,7 @@ def launch_db_system_launch_db_system_details(ctx, from_json, wait_for_state, ma @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'fault-domains': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'backup-network-nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'db-system-options': {'module': 'database', 'class': 'DbSystemOptions'}, 'ssh-public-keys': {'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))'}, 'data-collection-options': {'module': 'database', 'class': 'DataCollectionOptions'}, 'db-home': {'module': 'database', 'class': 'CreateDbHomeForStandbyDbSystem'}}, output_type={'module': 'database', 'class': 'DbSystem'}) @cli_util.wrap_exceptions -def launch_db_system_launch_standby_db_system_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, ssh_public_keys, hostname, primary_db_system_id, db_home, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, license_model, opc_dry_run): +def launch_db_system_launch_standby_db_system_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, hostname, primary_db_system_id, db_home, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, ssh_public_keys, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, license_model, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -24938,7 +24942,6 @@ def launch_db_system_launch_standby_db_system_details(ctx, from_json, wait_for_s _details['availabilityDomain'] = availability_domain _details['subnetId'] = subnet_id _details['shape'] = shape - _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) _details['hostname'] = hostname _details['primaryDbSystemId'] = primary_db_system_id _details['dbHome'] = cli_util.parse_json_parameter("db_home", db_home) @@ -24970,6 +24973,9 @@ def launch_db_system_launch_standby_db_system_details(ctx, from_json, wait_for_s if sparse_diskgroup is not None: _details['sparseDiskgroup'] = sparse_diskgroup + if ssh_public_keys is not None: + _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) + if domain is not None: _details['domain'] = domain @@ -25079,7 +25085,6 @@ def launch_db_system_launch_standby_db_system_details(ctx, from_json, wait_for_s @cli_util.option('--shape', required=True, help=u"""The shape of the DB system. The shape determines resources allocated to the DB system. - For virtual machine shapes, the number of CPU cores and memory - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage To get a list of shapes, use the [ListDbSystemShapes] operation.""") -@cli_util.option('--ssh-public-keys', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--hostname', required=True, help=u"""The hostname for the DB system. The hostname must begin with an alphabetic character, and can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. The maximum length of the combined hostname and domain is 63 characters. @@ -25106,6 +25111,7 @@ def launch_db_system_launch_standby_db_system_details(ctx, from_json, wait_for_s @cli_util.option('--db-system-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--storage-volume-performance-mode', type=custom_types.CliCaseInsensitiveChoice(["BALANCED", "HIGH_PERFORMANCE"]), help=u"""The block storage volume performance level. Valid values are `BALANCED` and `HIGH_PERFORMANCE`. See [Block Volume Performance] for more information.""") @cli_util.option('--sparse-diskgroup', type=click.BOOL, help=u"""If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured.""") +@cli_util.option('--ssh-public-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--domain', help=u"""A domain name used for the DB system. If the Oracle-provided Internet and VCN Resolver is enabled for the specified subnet, the domain name for the subnet is used (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted.""") @cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPU cores to enable for a bare metal or Exadata DB system or AMD VMDB Systems. The valid values depend on the specified shape: @@ -25140,7 +25146,7 @@ def launch_db_system_launch_standby_db_system_details(ctx, from_json, wait_for_s @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'fault-domains': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'backup-network-nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'db-system-options': {'module': 'database', 'class': 'DbSystemOptions'}, 'ssh-public-keys': {'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))'}, 'data-collection-options': {'module': 'database', 'class': 'DataCollectionOptions'}, 'db-home': {'module': 'database', 'class': 'CreateDbHomeFromDbSystemDetails'}}, output_type={'module': 'database', 'class': 'DbSystem'}) @cli_util.wrap_exceptions -def launch_db_system_launch_db_system_from_db_system_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, ssh_public_keys, hostname, source_db_system_id, db_home, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, license_model, opc_dry_run): +def launch_db_system_launch_db_system_from_db_system_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, hostname, source_db_system_id, db_home, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, ssh_public_keys, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, license_model, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -25151,7 +25157,6 @@ def launch_db_system_launch_db_system_from_db_system_details(ctx, from_json, wai _details['availabilityDomain'] = availability_domain _details['subnetId'] = subnet_id _details['shape'] = shape - _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) _details['hostname'] = hostname _details['sourceDbSystemId'] = source_db_system_id _details['dbHome'] = cli_util.parse_json_parameter("db_home", db_home) @@ -25183,6 +25188,9 @@ def launch_db_system_launch_db_system_from_db_system_details(ctx, from_json, wai if sparse_diskgroup is not None: _details['sparseDiskgroup'] = sparse_diskgroup + if ssh_public_keys is not None: + _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) + if domain is not None: _details['domain'] = domain @@ -25292,7 +25300,6 @@ def launch_db_system_launch_db_system_from_db_system_details(ctx, from_json, wai @cli_util.option('--shape', required=True, help=u"""The shape of the DB system. The shape determines resources allocated to the DB system. - For virtual machine shapes, the number of CPU cores and memory - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage To get a list of shapes, use the [ListDbSystemShapes] operation.""") -@cli_util.option('--ssh-public-keys', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--hostname', required=True, help=u"""The hostname for the DB system. The hostname must begin with an alphabetic character, and can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. The maximum length of the combined hostname and domain is 63 characters. @@ -25319,6 +25326,7 @@ def launch_db_system_launch_db_system_from_db_system_details(ctx, from_json, wai @cli_util.option('--db-system-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--storage-volume-performance-mode', type=custom_types.CliCaseInsensitiveChoice(["BALANCED", "HIGH_PERFORMANCE"]), help=u"""The block storage volume performance level. Valid values are `BALANCED` and `HIGH_PERFORMANCE`. See [Block Volume Performance] for more information.""") @cli_util.option('--sparse-diskgroup', type=click.BOOL, help=u"""If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured.""") +@cli_util.option('--ssh-public-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--domain', help=u"""A domain name used for the DB system. If the Oracle-provided Internet and VCN Resolver is enabled for the specified subnet, the domain name for the subnet is used (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted.""") @cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPU cores to enable for a bare metal or Exadata DB system or AMD VMDB Systems. The valid values depend on the specified shape: @@ -25354,7 +25362,7 @@ def launch_db_system_launch_db_system_from_db_system_details(ctx, from_json, wai @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'fault-domains': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'backup-network-nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'db-system-options': {'module': 'database', 'class': 'DbSystemOptions'}, 'ssh-public-keys': {'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))'}, 'data-collection-options': {'module': 'database', 'class': 'DataCollectionOptions'}, 'db-home': {'module': 'database', 'class': 'CreateDbHomeFromDatabaseDetails'}}, output_type={'module': 'database', 'class': 'DbSystem'}) @cli_util.wrap_exceptions -def launch_db_system_launch_db_system_from_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, ssh_public_keys, hostname, db_home, database_edition, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, disk_redundancy, license_model, opc_dry_run): +def launch_db_system_launch_db_system_from_database_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, hostname, db_home, database_edition, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, ssh_public_keys, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, disk_redundancy, license_model, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -25365,7 +25373,6 @@ def launch_db_system_launch_db_system_from_database_details(ctx, from_json, wait _details['availabilityDomain'] = availability_domain _details['subnetId'] = subnet_id _details['shape'] = shape - _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) _details['hostname'] = hostname _details['dbHome'] = cli_util.parse_json_parameter("db_home", db_home) _details['databaseEdition'] = database_edition @@ -25397,6 +25404,9 @@ def launch_db_system_launch_db_system_from_database_details(ctx, from_json, wait if sparse_diskgroup is not None: _details['sparseDiskgroup'] = sparse_diskgroup + if ssh_public_keys is not None: + _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) + if domain is not None: _details['domain'] = domain @@ -25509,7 +25519,6 @@ def launch_db_system_launch_db_system_from_database_details(ctx, from_json, wait @cli_util.option('--shape', required=True, help=u"""The shape of the DB system. The shape determines resources allocated to the DB system. - For virtual machine shapes, the number of CPU cores and memory - For bare metal and Exadata shapes, the number of CPU cores, memory, and storage To get a list of shapes, use the [ListDbSystemShapes] operation.""") -@cli_util.option('--ssh-public-keys', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--hostname', required=True, help=u"""The hostname for the DB system. The hostname must begin with an alphabetic character, and can contain alphanumeric characters and hyphens (-). The maximum length of the hostname is 16 characters for bare metal and virtual machine DB systems, and 12 characters for Exadata DB systems. The maximum length of the combined hostname and domain is 63 characters. @@ -25536,6 +25545,7 @@ def launch_db_system_launch_db_system_from_database_details(ctx, from_json, wait @cli_util.option('--db-system-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--storage-volume-performance-mode', type=custom_types.CliCaseInsensitiveChoice(["BALANCED", "HIGH_PERFORMANCE"]), help=u"""The block storage volume performance level. Valid values are `BALANCED` and `HIGH_PERFORMANCE`. See [Block Volume Performance] for more information.""") @cli_util.option('--sparse-diskgroup', type=click.BOOL, help=u"""If true, Sparse Diskgroup is configured for Exadata dbsystem. If False, Sparse diskgroup is not configured.""") +@cli_util.option('--ssh-public-keys', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The public key portion of the key pair to use for SSH access to the DB system. Multiple public keys can be provided. The length of the combined keys cannot exceed 40,000 characters.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--domain', help=u"""A domain name used for the DB system. If the Oracle-provided Internet and VCN Resolver is enabled for the specified subnet, the domain name for the subnet is used (do not provide one). Otherwise, provide a valid DNS domain name. Hyphens (-) are not permitted.""") @cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPU cores to enable for a bare metal or Exadata DB system or AMD VMDB Systems. The valid values depend on the specified shape: @@ -25571,7 +25581,7 @@ def launch_db_system_launch_db_system_from_database_details(ctx, from_json, wait @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'fault-domains': {'module': 'database', 'class': 'list[string]'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'backup-network-nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'db-system-options': {'module': 'database', 'class': 'DbSystemOptions'}, 'ssh-public-keys': {'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))'}, 'data-collection-options': {'module': 'database', 'class': 'DataCollectionOptions'}, 'db-home': {'module': 'database', 'class': 'CreateDbHomeFromBackupDetails'}}, output_type={'module': 'database', 'class': 'DbSystem'}) @cli_util.wrap_exceptions -def launch_db_system_launch_db_system_from_backup_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, ssh_public_keys, hostname, db_home, database_edition, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, disk_redundancy, license_model, opc_dry_run): +def launch_db_system_launch_db_system_from_backup_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, availability_domain, subnet_id, shape, hostname, db_home, database_edition, fault_domains, display_name, backup_subnet_id, nsg_ids, backup_network_nsg_ids, time_zone, db_system_options, storage_volume_performance_mode, sparse_diskgroup, ssh_public_keys, domain, cpu_core_count, cluster_name, data_storage_percentage, initial_data_storage_size_in_gb, kms_key_id, kms_key_version_id, node_count, freeform_tags, defined_tags, security_attributes, private_ip, private_ip_v6, cluster_placement_group_id, subscription_id, data_collection_options, compute_model, compute_count, disk_redundancy, license_model, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -25582,7 +25592,6 @@ def launch_db_system_launch_db_system_from_backup_details(ctx, from_json, wait_f _details['availabilityDomain'] = availability_domain _details['subnetId'] = subnet_id _details['shape'] = shape - _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) _details['hostname'] = hostname _details['dbHome'] = cli_util.parse_json_parameter("db_home", db_home) _details['databaseEdition'] = database_edition @@ -25614,6 +25623,9 @@ def launch_db_system_launch_db_system_from_backup_details(ctx, from_json, wait_f if sparse_diskgroup is not None: _details['sparseDiskgroup'] = sparse_diskgroup + if ssh_public_keys is not None: + _details['sshPublicKeys'] = cli_util.parse_json_parameter("ssh_public_keys", ssh_public_keys) + if domain is not None: _details['domain'] = domain @@ -27031,6 +27043,57 @@ def list_autonomous_vm_clusters(ctx, from_json, all_pages, page_size, compartmen cli_util.render_response(result, ctx) +@autonomous_database_group.command(name=cli_util.override('db.list_available_maintenance_windows.command_name', 'list-available-maintenance-windows'), help=u"""Retrieves the list of available maintenance window options for the specified Autonomous AI Database. \n[Command Reference](listAvailableMaintenanceWindows)""") +@cli_util.option('--autonomous-database-id', required=True, help=u"""The database [OCID].""") +@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return per page.""") +@cli_util.option('--page', help=u"""The pagination token to continue listing from.""") +@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': 'database', 'class': 'AutonomousDatabaseMaintenanceWindowCollection'}) +@cli_util.wrap_exceptions +def list_available_maintenance_windows(ctx, from_json, all_pages, page_size, autonomous_database_id, limit, page): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + 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') + + kwargs = {} + if limit is not None: + kwargs['limit'] = limit + if page is not None: + kwargs['page'] = page + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('database', 'database', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_available_maintenance_windows, + autonomous_database_id=autonomous_database_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_available_maintenance_windows, + limit, + page_size, + autonomous_database_id=autonomous_database_id, + **kwargs + ) + else: + result = client.list_available_maintenance_windows( + autonomous_database_id=autonomous_database_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @backup_destination_summary_group.command(name=cli_util.override('db.list_backup_destination.command_name', 'list-backup-destination'), help=u"""Gets a list of backup destinations in the specified compartment. \n[Command Reference](listBackupDestination)""") @cli_util.option('--compartment-id', required=True, help=u"""The compartment [OCID].""") @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return per page.""") @@ -36030,6 +36093,8 @@ def update_autonomous_container_database_dataguard_association(ctx, from_json, w @cli_util.option('--autonomous-maintenance-schedule-type', type=custom_types.CliCaseInsensitiveChoice(["EARLY", "REGULAR"]), help=u"""The maintenance schedule type of the Autonomous AI Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle""") @cli_util.option('--autonomous-database-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--time-maintenance-pause-until', type=custom_types.CLI_DATETIME, help=u"""The date until which Autonomous AI Database maintenance is temporarily paused.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) +@cli_util.option('--scheduled-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--time-scheduled-maintenance-window-update', type=custom_types.CLI_DATETIME, help=u"""The date and time at which operation to change Maintenance Window is scheduled to take place.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) @cli_util.option('--is-backup-retention-locked', type=click.BOOL, help=u"""True if the Autonomous AI Database is backup retention locked.""") @cli_util.option('--time-scheduled-db-version-upgrade', type=custom_types.CLI_DATETIME, help=u"""The date and time the Autonomous AI Database scheduled to upgrade to 26ai.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) @cli_util.option('--is-disable-db-version-upgrade-schedule', type=click.BOOL, help=u"""True if user wants to disable Autonomous AI Database scheduled upgrade to 26ai.""") @@ -36064,18 +36129,18 @@ def update_autonomous_container_database_dataguard_association(ctx, from_json, w @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING", "RECREATING", "ROLE_CHANGE_IN_PROGRESS", "UPGRADING", "INACCESSIBLE", "STANDBY", "TRANSPORTING"]), 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 PROVISIONING --wait-for-state TRANSPORTING 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({'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'}}) +@json_skeleton_utils.get_cli_json_input_option({'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-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'}}) @cli_util.help_option @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'}) +@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-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, 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): +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, scheduled_maintenance_window, time_scheduled_maintenance_window_update, 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') if not force: - if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details or encryption_key: - if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details and encryption-key will replace any existing values. Are you sure you want to continue?"): + if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details or encryption_key: + if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details and encryption-key will replace any existing values. Are you sure you want to continue?"): ctx.abort() kwargs = {} @@ -36243,6 +36308,12 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s if time_maintenance_pause_until is not None: _details['timeMaintenancePauseUntil'] = time_maintenance_pause_until + if scheduled_maintenance_window is not None: + _details['scheduledMaintenanceWindow'] = cli_util.parse_json_parameter("scheduled_maintenance_window", scheduled_maintenance_window) + + if time_scheduled_maintenance_window_update is not None: + _details['timeScheduledMaintenanceWindowUpdate'] = time_scheduled_maintenance_window_update + if is_backup_retention_locked is not None: _details['isBackupRetentionLocked'] = is_backup_retention_locked @@ -36317,2618 +36388,6 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s cli_util.render_response(result, ctx) -@autonomous_database_group.command(name=cli_util.override('db.update_autonomous_database_okv_key_details.command_name', 'update-autonomous-database-okv-key-details'), help=u"""Updates one or more attributes of the specified Autonomous AI Database. See the UpdateAutonomousDatabaseDetails resource for a full list of attributes that can be updated. \n[Command Reference](updateAutonomousDatabase)""") -@cli_util.option('--autonomous-database-id', required=True, help=u"""The database [OCID].""") -@cli_util.option('--encryption-key-okv-uri', required=True, help=u"""URI of OKV server""") -@cli_util.option('--encryption-key-okv-kms-key', required=True, help=u"""UUID of OKV KMS Key""") -@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('--backup-retention-period-in-days', type=click.INT, help=u"""Retention period, in days, for long-term backups""") -@cli_util.option('--compute-model', type=custom_types.CliCaseInsensitiveChoice(["ECPU", "OCPU"]), help=u"""The compute model of the Autonomous AI Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ECPU compute model is the recommended model and OCPU compute model is legacy.""") -@cli_util.option('--in-memory-percentage', type=click.INT, help=u"""The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous AI Database. This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform.""") -@cli_util.option('--local-adg-auto-failover-max-data-loss-limit', type=click.INT, help=u"""Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard""") -@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPUs to be made available to the Autonomous AI Database.
For Autonomous AI Databases on Dedicated Exadata Infrastructure: - The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. - It is suggested to use 'computeCount' parameter if you want to use fractional value to provision less than 1 core. - -**Note:** This parameter cannot be used with the `ocpuCount` or `computeCount` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--long-term-backup-schedule', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-dev-tier', type=click.BOOL, help=u"""Autonomous AI Database for Developers are fixed-shape Autonomous AI Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database.""") -@cli_util.option('--compute-count', type=click.FLOAT, help=u"""The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous AI Database Serverless instance or an Autonomous AI Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--ocpu-count', type=click.FLOAT, help=u"""The number of OCPU cores to be made available to the Autonomous AI Database. - -For Autonomous AI Databases on Dedicated Exadata Infrastructure, you can specify a fractional value for this parameter. Fractional values are not supported for Autonomous AI Database Serverless instances. For Autonomous AI Database Serverless instances, this parameter is not used. - -To provision less than 1 core, enter a fractional value in an increment of 0.1. To provision 1 or more cores, you must enter an integer between 1 and the maximum number of cores available to the infrastructure shape. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. Likewise, you can provision 2 cores or 3 cores, but not 2.5 cores. The maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") -@cli_util.option('--data-storage-size-in-tbs', type=click.INT, help=u"""The size, in terabytes, of the data volume that will be created and attached to the database. For Autonomous AI Databases on dedicated Exadata infrastructure, the maximum storage value is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. A full Exadata service is allocated when the Autonomous AI Database size is set to the upper limit (384 TB). - -**Note:** This parameter cannot be used with the `dataStorageSizeInGBs` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--data-storage-size-in-gbs', type=click.INT, help=u"""Applies to dedicated Exadata infrastructure only. - -The size, in gigabytes, of the data volume that will be created and attached to the database. The maximum storage value depends on the system shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `dataStorageSizeInTBs` parameter.""") -@cli_util.option('--display-name', help=u"""The user-friendly name for the Autonomous AI Database. The name does not have to be unique. The display name can only be updated for Autonomous AI Databases using dedicated Exadata Infrastructure. This parameter may not be updated in parallel with dbVersion.""") -@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). - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, or isFreeTier.""") -@cli_util.option('--db-name', help=u"""New name for this Autonomous AI Database. For Autonomous AI Databases on Dedicated Exadata Infrastructure, the name must begin with an alphabetic character, and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. For Autonomous AI Database Serverless instances, the name must begin with an alphabetic character, and can contain a maximum of 30 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails.""") -@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].""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Security Attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Oracle-ZPR\": {\"MaxEgressCount\": {\"value\": \"42\", \"mode\": \"audit\"}}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--db-workload', type=custom_types.CliCaseInsensitiveChoice(["OLTP", "DW", "AJD", "APEX", "LH"]), help=u"""The Autonomous AI Database workload type. The following values are valid: - OLTP - indicates an Autonomous AI Transaction Processing database - DW - indicates an Autonomous AI Lakehouse database - AJD - indicates an Autonomous AI JSON Database - APEX - indicates an Autonomous AI Database with the Oracle APEX AI Application Development workload type. - LH - indicates an Oracle Autonomous AI Lakehouse database - -**Note** Starting December 2026, DW will not be supported as a valid value for this parameter. When creating an Autonomous AI Database, if this parameter is not specified, the default value is `OLTP`. - - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--license-model', type=custom_types.CliCaseInsensitiveChoice(["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"]), help=u"""The Oracle license model that applies to the Oracle Autonomous AI Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle AI Database software licenses and the Oracle AI Database service. Note that when provisioning an [Autonomous AI Database on dedicated Exadata infrastructure], this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous AI Database Serverless] database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--byol-compute-count-limit', type=click.FLOAT, help=u"""The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed.""") -@cli_util.option('--is-access-control-enabled', type=click.BOOL, help=u"""Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - -This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform. For Autonomous AI Database Serverless instances, `whitelistedIps` is used.""") -@cli_util.option('--whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--are-primary-whitelisted-ips-used', type=click.BOOL, help=u"""This field will be null if the Autonomous AI Database is not Data Guard enabled or Access Control is disabled. `TRUE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses the primary's IP access control list (ACL) for standby. `FALSE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses a different IP access control list (ACL) for standby compared to primary.""") -@cli_util.option('--standby-whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates whether auto scaling is enabled for the Autonomous AI Database CPU core count. Setting to `TRUE` enables auto scaling. Setting to `FALSE` disables auto scaling. The default value is `TRUE`. Auto scaling is only available for [Autonomous AI Database Serverless instances].""") -@cli_util.option('--is-refreshable-clone', type=click.BOOL, help=u"""Indicates if the Autonomous AI Database is a refreshable clone. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--refreshable-mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "MANUAL"]), help=u"""The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous AI Database.""") -@cli_util.option('--is-local-data-guard-enabled', type=click.BOOL, help=u"""Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -This cannot be updated in parallel with any of the following: isMTLSRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--is-data-guard-enabled', type=click.BOOL, help=u"""** Deprecated. ** Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -To delete a cross-region standby database, provide the `peerDbId` for the standby database in a remote region, and set `isDataGuardEnabled` to `FALSE`.""") -@cli_util.option('--peer-db-id', help=u"""The database OCID(/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. - -To create or delete a local (in-region) standby, see the `isDataGuardEnabled` parameter. - -When disconnecting a cross-region standby, specify the standby database OCID in this parameter together with `isDisconnectPeer=true`.""") -@cli_util.option('--db-version', help=u"""A valid Oracle AI Database version for Autonomous AI Database. When you specify 23ai for dbversion, the system will provision a 23ai database, but the UI will display it as 26ai. When you specify 26ai for dbversion, the system will provision and display a 26ai database as expected. For new databases, it is recommended to use either 19c or 26ai. - -**Note** Starting December 2026, 23ai will not be supported as a valid value for this parameter.""") -@cli_util.option('--open-mode', type=custom_types.CliCaseInsensitiveChoice(["READ_ONLY", "READ_WRITE"]), help=u"""Indicates the Autonomous AI Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--permission-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "UNRESTRICTED"]), help=u"""The Autonomous AI Database permission level. Restricted mode allows access only by admin users. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet the resource is associated with. - -**Subnet Restrictions:** - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. - For Autonomous AI Database, setting this will disable public secure access to the database. - -These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet.""") -@cli_util.option('--private-endpoint-label', help=u"""The resource's private endpoint label. - Setting the endpoint label to a non-empty string creates a private endpoint database. - Resetting the endpoint label to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. - Setting the endpoint label to a non-empty string value, updates to a new private endpoint database, when the database is disabled and re-enabled. - -This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--private-endpoint-ip', help=u"""The private endpoint Ip address for the resource.""") -@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of [OCIDs] for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules]. **NsgIds restrictions:** - A network security group (NSG) is optional for Autonomous AI Databases with private access. The nsgIds list can be empty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--auto-refresh-frequency-in-seconds', type=click.INT, help=u"""The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter.""") -@cli_util.option('--auto-refresh-point-lag-in-seconds', type=click.INT, help=u"""The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens.""") -@cli_util.option('--time-of-auto-refresh-start', type=custom_types.CLI_DATETIME, help=u"""The the date and time that auto-refreshing will begin for an Autonomous AI Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--customer-contacts', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Customer Contacts. Setting this to an empty list removes all customer contacts of an Oracle - -This cannot be updated in parallel with any of the following: isMTLSConnectionRequired, scheduledOperations, or dbToolsDetails. - -This option is a JSON list with items of type CustomerContact. For documentation on CustomerContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/CustomerContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-mtls-connection-required', type=click.BOOL, help=u"""Specifies if the Autonomous AI Database requires mTLS connections. - -This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: - CreateAutonomousDatabase - GetAutonomousDatabase - UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous AI Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true.""") -@cli_util.option('--resource-pool-leader-id', help=u"""The unique identifier for leader Autonomous AI Database OCID [OCID].""") -@cli_util.option('--resource-pool-summary', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--autonomous-maintenance-schedule-type', type=custom_types.CliCaseInsensitiveChoice(["EARLY", "REGULAR"]), help=u"""The maintenance schedule type of the Autonomous AI Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle""") -@cli_util.option('--autonomous-database-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--time-maintenance-pause-until', type=custom_types.CLI_DATETIME, help=u"""The date until which Autonomous AI Database maintenance is temporarily paused.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-backup-retention-locked', type=click.BOOL, help=u"""True if the Autonomous AI Database is backup retention locked.""") -@cli_util.option('--time-scheduled-db-version-upgrade', type=custom_types.CLI_DATETIME, help=u"""The date and time the Autonomous AI Database scheduled to upgrade to 26ai.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-disable-db-version-upgrade-schedule', type=click.BOOL, help=u"""True if user wants to disable Autonomous AI Database scheduled upgrade to 26ai.""") -@cli_util.option('--is-schedule-db-version-upgrade-to-earliest', type=click.BOOL, help=u"""True if user wants to schedule Autonomous AI Database upgrade to the earliest available time.""") -@cli_util.option('--scheduled-operations', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type ScheduledOperationDetails. For documentation on ScheduledOperationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ScheduledOperationDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-for-storage-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Autonomous AI Database storage. The default value is `FALSE`.""") -@cli_util.option('--database-edition', help=u"""The Oracle AI Database Edition that applies to the Autonomous AI Databases. This parameter accepts options `STANDARD_EDITION` and `ENTERPRISE_EDITION`. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--db-tools-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database tools details. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type DatabaseTool. For documentation on DatabaseTool please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/DatabaseTool.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--vanity-url-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--secret-id', help=u"""The OCI vault secret [/Content/General/Concepts/identifiers.htm]OCID. This cannot be used in conjunction with adminPassword.""") -@cli_util.option('--secret-version-number', type=click.INT, help=u"""The version of the vault secret. If no version is specified, the latest version will be used.""") -@cli_util.option('--is-disconnect-peer', type=click.BOOL, help=u"""If true, this disconnects the Autonomous AI Database from its peer. After the disconnect completes, the Autonomous AI Database works permanently as a standalone database. - -**Warning:** A disconnected standby is no longer part of the disaster recovery configuration. Operations and restrictions that apply to a connected standby do not apply in the same way after the database has been disconnected. - -To disconnect a cross region standby, also provide the OCID of the standby database in the `peerDbId` parameter.""") -@cli_util.option('--local-adg-resource-pool-leader-id', help=u"""The [OCID] of a dedicated resource pool leader Autonomous AI Database in the same region, that is required when local Autonomous Data Guard is enabled for a dedicated resource pool member using the parameter `isLocalDataGuardEnabled`. This field applies only to dedicated resource pool members, and the specified leader must be different from the primary\u2019s leader. Local Autonomous Data Guard can be enabled only if more than one dedicated resource pool exists in the region.""") -@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('--opc-dry-run', type=click.BOOL, help=u"""Indicates that the request is a dry run, if set to \"true\". A dry run request does not actually creating or updating a resource and is used only to perform validation on the submitted data.""") -@cli_util.option('--encryption-key-certificate-id', help=u"""OKV certificate id""") -@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) -@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING", "RECREATING", "ROLE_CHANGE_IN_PROGRESS", "UPGRADING", "INACCESSIBLE", "STANDBY", "TRANSPORTING"]), 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 PROVISIONING --wait-for-state TRANSPORTING 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({'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'}}) -@cli_util.help_option -@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, 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') - if not force: - if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details: - if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details 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 - if opc_dry_run is not None: - kwargs['opc_dry_run'] = opc_dry_run - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['encryptionKey'] = {} - _details['encryptionKey']['okvUri'] = encryption_key_okv_uri - _details['encryptionKey']['okvKmsKey'] = encryption_key_okv_kms_key - _details['encryptionKey']['directoryName'] = encryption_key_directory_name - _details['encryptionKey']['certificateDirectoryName'] = encryption_key_certificate_directory_name - - if backup_retention_period_in_days is not None: - _details['backupRetentionPeriodInDays'] = backup_retention_period_in_days - - if compute_model is not None: - _details['computeModel'] = compute_model - - if in_memory_percentage is not None: - _details['inMemoryPercentage'] = in_memory_percentage - - if local_adg_auto_failover_max_data_loss_limit is not None: - _details['localAdgAutoFailoverMaxDataLossLimit'] = local_adg_auto_failover_max_data_loss_limit - - if cpu_core_count is not None: - _details['cpuCoreCount'] = cpu_core_count - - if long_term_backup_schedule is not None: - _details['longTermBackupSchedule'] = cli_util.parse_json_parameter("long_term_backup_schedule", long_term_backup_schedule) - - if is_dev_tier is not None: - _details['isDevTier'] = is_dev_tier - - if compute_count is not None: - _details['computeCount'] = compute_count - - if ocpu_count is not None: - _details['ocpuCount'] = ocpu_count - - if data_storage_size_in_tbs is not None: - _details['dataStorageSizeInTBs'] = data_storage_size_in_tbs - - if data_storage_size_in_gbs is not None: - _details['dataStorageSizeInGBs'] = data_storage_size_in_gbs - - if display_name is not None: - _details['displayName'] = display_name - - 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 - - if db_name is not None: - _details['dbName'] = db_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) - - if security_attributes is not None: - _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) - - if db_workload is not None: - _details['dbWorkload'] = db_workload - - if license_model is not None: - _details['licenseModel'] = license_model - - if byol_compute_count_limit is not None: - _details['byolComputeCountLimit'] = byol_compute_count_limit - - if is_access_control_enabled is not None: - _details['isAccessControlEnabled'] = is_access_control_enabled - - if whitelisted_ips is not None: - _details['whitelistedIps'] = cli_util.parse_json_parameter("whitelisted_ips", whitelisted_ips) - - if are_primary_whitelisted_ips_used is not None: - _details['arePrimaryWhitelistedIpsUsed'] = are_primary_whitelisted_ips_used - - if standby_whitelisted_ips is not None: - _details['standbyWhitelistedIps'] = cli_util.parse_json_parameter("standby_whitelisted_ips", standby_whitelisted_ips) - - if is_auto_scaling_enabled is not None: - _details['isAutoScalingEnabled'] = is_auto_scaling_enabled - - if is_refreshable_clone is not None: - _details['isRefreshableClone'] = is_refreshable_clone - - if refreshable_mode is not None: - _details['refreshableMode'] = refreshable_mode - - if is_local_data_guard_enabled is not None: - _details['isLocalDataGuardEnabled'] = is_local_data_guard_enabled - - if is_data_guard_enabled is not None: - _details['isDataGuardEnabled'] = is_data_guard_enabled - - if peer_db_id is not None: - _details['peerDbId'] = peer_db_id - - if db_version is not None: - _details['dbVersion'] = db_version - - if open_mode is not None: - _details['openMode'] = open_mode - - if permission_level is not None: - _details['permissionLevel'] = permission_level - - if subnet_id is not None: - _details['subnetId'] = subnet_id - - if private_endpoint_label is not None: - _details['privateEndpointLabel'] = private_endpoint_label - - if private_endpoint_ip is not None: - _details['privateEndpointIp'] = private_endpoint_ip - - if nsg_ids is not None: - _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids) - - if auto_refresh_frequency_in_seconds is not None: - _details['autoRefreshFrequencyInSeconds'] = auto_refresh_frequency_in_seconds - - if auto_refresh_point_lag_in_seconds is not None: - _details['autoRefreshPointLagInSeconds'] = auto_refresh_point_lag_in_seconds - - if time_of_auto_refresh_start is not None: - _details['timeOfAutoRefreshStart'] = time_of_auto_refresh_start - - if customer_contacts is not None: - _details['customerContacts'] = cli_util.parse_json_parameter("customer_contacts", customer_contacts) - - if is_mtls_connection_required is not None: - _details['isMtlsConnectionRequired'] = is_mtls_connection_required - - if resource_pool_leader_id is not None: - _details['resourcePoolLeaderId'] = resource_pool_leader_id - - if resource_pool_summary is not None: - _details['resourcePoolSummary'] = cli_util.parse_json_parameter("resource_pool_summary", resource_pool_summary) - - if autonomous_maintenance_schedule_type is not None: - _details['autonomousMaintenanceScheduleType'] = autonomous_maintenance_schedule_type - - if autonomous_database_maintenance_window is not None: - _details['autonomousDatabaseMaintenanceWindow'] = cli_util.parse_json_parameter("autonomous_database_maintenance_window", autonomous_database_maintenance_window) - - if time_maintenance_pause_until is not None: - _details['timeMaintenancePauseUntil'] = time_maintenance_pause_until - - if is_backup_retention_locked is not None: - _details['isBackupRetentionLocked'] = is_backup_retention_locked - - if time_scheduled_db_version_upgrade is not None: - _details['timeScheduledDbVersionUpgrade'] = time_scheduled_db_version_upgrade - - if is_disable_db_version_upgrade_schedule is not None: - _details['isDisableDbVersionUpgradeSchedule'] = is_disable_db_version_upgrade_schedule - - if is_schedule_db_version_upgrade_to_earliest is not None: - _details['isScheduleDbVersionUpgradeToEarliest'] = is_schedule_db_version_upgrade_to_earliest - - if scheduled_operations is not None: - _details['scheduledOperations'] = cli_util.parse_json_parameter("scheduled_operations", scheduled_operations) - - if is_auto_scaling_for_storage_enabled is not None: - _details['isAutoScalingForStorageEnabled'] = is_auto_scaling_for_storage_enabled - - if database_edition is not None: - _details['databaseEdition'] = database_edition - - if db_tools_details is not None: - _details['dbToolsDetails'] = cli_util.parse_json_parameter("db_tools_details", db_tools_details) - - if vanity_url_details is not None: - _details['vanityUrlDetails'] = cli_util.parse_json_parameter("vanity_url_details", vanity_url_details) - - if secret_id is not None: - _details['secretId'] = secret_id - - if secret_version_number is not None: - _details['secretVersionNumber'] = secret_version_number - - if is_disconnect_peer is not None: - _details['isDisconnectPeer'] = is_disconnect_peer - - if local_adg_resource_pool_leader_id is not None: - _details['localAdgResourcePoolLeaderId'] = local_adg_resource_pool_leader_id - - if encryption_key_certificate_id is not None: - _details['encryptionKey']['certificateId'] = encryption_key_certificate_id - - _details['encryptionKey']['provider'] = 'OKV' - - client = cli_util.build_client('database', 'database', ctx) - result = client.update_autonomous_database( - autonomous_database_id=autonomous_database_id, - update_autonomous_database_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_autonomous_database') and callable(getattr(client, 'get_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_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) - - -@autonomous_database_group.command(name=cli_util.override('db.update_autonomous_database_azure_key_details.command_name', 'update-autonomous-database-azure-key-details'), help=u"""Updates one or more attributes of the specified Autonomous AI Database. See the UpdateAutonomousDatabaseDetails resource for a full list of attributes that can be updated. \n[Command Reference](updateAutonomousDatabase)""") -@cli_util.option('--autonomous-database-id', required=True, help=u"""The database [OCID].""") -@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('--backup-retention-period-in-days', type=click.INT, help=u"""Retention period, in days, for long-term backups""") -@cli_util.option('--compute-model', type=custom_types.CliCaseInsensitiveChoice(["ECPU", "OCPU"]), help=u"""The compute model of the Autonomous AI Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ECPU compute model is the recommended model and OCPU compute model is legacy.""") -@cli_util.option('--in-memory-percentage', type=click.INT, help=u"""The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous AI Database. This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform.""") -@cli_util.option('--local-adg-auto-failover-max-data-loss-limit', type=click.INT, help=u"""Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard""") -@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPUs to be made available to the Autonomous AI Database.
For Autonomous AI Databases on Dedicated Exadata Infrastructure: - The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. - It is suggested to use 'computeCount' parameter if you want to use fractional value to provision less than 1 core. - -**Note:** This parameter cannot be used with the `ocpuCount` or `computeCount` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--long-term-backup-schedule', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-dev-tier', type=click.BOOL, help=u"""Autonomous AI Database for Developers are fixed-shape Autonomous AI Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database.""") -@cli_util.option('--compute-count', type=click.FLOAT, help=u"""The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous AI Database Serverless instance or an Autonomous AI Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--ocpu-count', type=click.FLOAT, help=u"""The number of OCPU cores to be made available to the Autonomous AI Database. - -For Autonomous AI Databases on Dedicated Exadata Infrastructure, you can specify a fractional value for this parameter. Fractional values are not supported for Autonomous AI Database Serverless instances. For Autonomous AI Database Serverless instances, this parameter is not used. - -To provision less than 1 core, enter a fractional value in an increment of 0.1. To provision 1 or more cores, you must enter an integer between 1 and the maximum number of cores available to the infrastructure shape. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. Likewise, you can provision 2 cores or 3 cores, but not 2.5 cores. The maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") -@cli_util.option('--data-storage-size-in-tbs', type=click.INT, help=u"""The size, in terabytes, of the data volume that will be created and attached to the database. For Autonomous AI Databases on dedicated Exadata infrastructure, the maximum storage value is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. A full Exadata service is allocated when the Autonomous AI Database size is set to the upper limit (384 TB). - -**Note:** This parameter cannot be used with the `dataStorageSizeInGBs` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--data-storage-size-in-gbs', type=click.INT, help=u"""Applies to dedicated Exadata infrastructure only. - -The size, in gigabytes, of the data volume that will be created and attached to the database. The maximum storage value depends on the system shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `dataStorageSizeInTBs` parameter.""") -@cli_util.option('--display-name', help=u"""The user-friendly name for the Autonomous AI Database. The name does not have to be unique. The display name can only be updated for Autonomous AI Databases using dedicated Exadata Infrastructure. This parameter may not be updated in parallel with dbVersion.""") -@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). - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, or isFreeTier.""") -@cli_util.option('--db-name', help=u"""New name for this Autonomous AI Database. For Autonomous AI Databases on Dedicated Exadata Infrastructure, the name must begin with an alphabetic character, and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. For Autonomous AI Database Serverless instances, the name must begin with an alphabetic character, and can contain a maximum of 30 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails.""") -@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].""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Security Attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Oracle-ZPR\": {\"MaxEgressCount\": {\"value\": \"42\", \"mode\": \"audit\"}}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--db-workload', type=custom_types.CliCaseInsensitiveChoice(["OLTP", "DW", "AJD", "APEX", "LH"]), help=u"""The Autonomous AI Database workload type. The following values are valid: - OLTP - indicates an Autonomous AI Transaction Processing database - DW - indicates an Autonomous AI Lakehouse database - AJD - indicates an Autonomous AI JSON Database - APEX - indicates an Autonomous AI Database with the Oracle APEX AI Application Development workload type. - LH - indicates an Oracle Autonomous AI Lakehouse database - -**Note** Starting December 2026, DW will not be supported as a valid value for this parameter. When creating an Autonomous AI Database, if this parameter is not specified, the default value is `OLTP`. - - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--license-model', type=custom_types.CliCaseInsensitiveChoice(["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"]), help=u"""The Oracle license model that applies to the Oracle Autonomous AI Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle AI Database software licenses and the Oracle AI Database service. Note that when provisioning an [Autonomous AI Database on dedicated Exadata infrastructure], this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous AI Database Serverless] database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--byol-compute-count-limit', type=click.FLOAT, help=u"""The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed.""") -@cli_util.option('--is-access-control-enabled', type=click.BOOL, help=u"""Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - -This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform. For Autonomous AI Database Serverless instances, `whitelistedIps` is used.""") -@cli_util.option('--whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--are-primary-whitelisted-ips-used', type=click.BOOL, help=u"""This field will be null if the Autonomous AI Database is not Data Guard enabled or Access Control is disabled. `TRUE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses the primary's IP access control list (ACL) for standby. `FALSE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses a different IP access control list (ACL) for standby compared to primary.""") -@cli_util.option('--standby-whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates whether auto scaling is enabled for the Autonomous AI Database CPU core count. Setting to `TRUE` enables auto scaling. Setting to `FALSE` disables auto scaling. The default value is `TRUE`. Auto scaling is only available for [Autonomous AI Database Serverless instances].""") -@cli_util.option('--is-refreshable-clone', type=click.BOOL, help=u"""Indicates if the Autonomous AI Database is a refreshable clone. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--refreshable-mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "MANUAL"]), help=u"""The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous AI Database.""") -@cli_util.option('--is-local-data-guard-enabled', type=click.BOOL, help=u"""Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -This cannot be updated in parallel with any of the following: isMTLSRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--is-data-guard-enabled', type=click.BOOL, help=u"""** Deprecated. ** Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -To delete a cross-region standby database, provide the `peerDbId` for the standby database in a remote region, and set `isDataGuardEnabled` to `FALSE`.""") -@cli_util.option('--peer-db-id', help=u"""The database OCID(/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. - -To create or delete a local (in-region) standby, see the `isDataGuardEnabled` parameter. - -When disconnecting a cross-region standby, specify the standby database OCID in this parameter together with `isDisconnectPeer=true`.""") -@cli_util.option('--db-version', help=u"""A valid Oracle AI Database version for Autonomous AI Database. When you specify 23ai for dbversion, the system will provision a 23ai database, but the UI will display it as 26ai. When you specify 26ai for dbversion, the system will provision and display a 26ai database as expected. For new databases, it is recommended to use either 19c or 26ai. - -**Note** Starting December 2026, 23ai will not be supported as a valid value for this parameter.""") -@cli_util.option('--open-mode', type=custom_types.CliCaseInsensitiveChoice(["READ_ONLY", "READ_WRITE"]), help=u"""Indicates the Autonomous AI Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--permission-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "UNRESTRICTED"]), help=u"""The Autonomous AI Database permission level. Restricted mode allows access only by admin users. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet the resource is associated with. - -**Subnet Restrictions:** - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. - For Autonomous AI Database, setting this will disable public secure access to the database. - -These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet.""") -@cli_util.option('--private-endpoint-label', help=u"""The resource's private endpoint label. - Setting the endpoint label to a non-empty string creates a private endpoint database. - Resetting the endpoint label to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. - Setting the endpoint label to a non-empty string value, updates to a new private endpoint database, when the database is disabled and re-enabled. - -This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--private-endpoint-ip', help=u"""The private endpoint Ip address for the resource.""") -@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of [OCIDs] for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules]. **NsgIds restrictions:** - A network security group (NSG) is optional for Autonomous AI Databases with private access. The nsgIds list can be empty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--auto-refresh-frequency-in-seconds', type=click.INT, help=u"""The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter.""") -@cli_util.option('--auto-refresh-point-lag-in-seconds', type=click.INT, help=u"""The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens.""") -@cli_util.option('--time-of-auto-refresh-start', type=custom_types.CLI_DATETIME, help=u"""The the date and time that auto-refreshing will begin for an Autonomous AI Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--customer-contacts', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Customer Contacts. Setting this to an empty list removes all customer contacts of an Oracle - -This cannot be updated in parallel with any of the following: isMTLSConnectionRequired, scheduledOperations, or dbToolsDetails. - -This option is a JSON list with items of type CustomerContact. For documentation on CustomerContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/CustomerContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-mtls-connection-required', type=click.BOOL, help=u"""Specifies if the Autonomous AI Database requires mTLS connections. - -This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: - CreateAutonomousDatabase - GetAutonomousDatabase - UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous AI Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true.""") -@cli_util.option('--resource-pool-leader-id', help=u"""The unique identifier for leader Autonomous AI Database OCID [OCID].""") -@cli_util.option('--resource-pool-summary', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--autonomous-maintenance-schedule-type', type=custom_types.CliCaseInsensitiveChoice(["EARLY", "REGULAR"]), help=u"""The maintenance schedule type of the Autonomous AI Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle""") -@cli_util.option('--autonomous-database-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--time-maintenance-pause-until', type=custom_types.CLI_DATETIME, help=u"""The date until which Autonomous AI Database maintenance is temporarily paused.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-backup-retention-locked', type=click.BOOL, help=u"""True if the Autonomous AI Database is backup retention locked.""") -@cli_util.option('--time-scheduled-db-version-upgrade', type=custom_types.CLI_DATETIME, help=u"""The date and time the Autonomous AI Database scheduled to upgrade to 26ai.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-disable-db-version-upgrade-schedule', type=click.BOOL, help=u"""True if user wants to disable Autonomous AI Database scheduled upgrade to 26ai.""") -@cli_util.option('--is-schedule-db-version-upgrade-to-earliest', type=click.BOOL, help=u"""True if user wants to schedule Autonomous AI Database upgrade to the earliest available time.""") -@cli_util.option('--scheduled-operations', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type ScheduledOperationDetails. For documentation on ScheduledOperationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ScheduledOperationDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-for-storage-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Autonomous AI Database storage. The default value is `FALSE`.""") -@cli_util.option('--database-edition', help=u"""The Oracle AI Database Edition that applies to the Autonomous AI Databases. This parameter accepts options `STANDARD_EDITION` and `ENTERPRISE_EDITION`. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--db-tools-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database tools details. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type DatabaseTool. For documentation on DatabaseTool please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/DatabaseTool.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--vanity-url-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--secret-id', help=u"""The OCI vault secret [/Content/General/Concepts/identifiers.htm]OCID. This cannot be used in conjunction with adminPassword.""") -@cli_util.option('--secret-version-number', type=click.INT, help=u"""The version of the vault secret. If no version is specified, the latest version will be used.""") -@cli_util.option('--is-disconnect-peer', type=click.BOOL, help=u"""If true, this disconnects the Autonomous AI Database from its peer. After the disconnect completes, the Autonomous AI Database works permanently as a standalone database. - -**Warning:** A disconnected standby is no longer part of the disaster recovery configuration. Operations and restrictions that apply to a connected standby do not apply in the same way after the database has been disconnected. - -To disconnect a cross region standby, also provide the OCID of the standby database in the `peerDbId` parameter.""") -@cli_util.option('--local-adg-resource-pool-leader-id', help=u"""The [OCID] of a dedicated resource pool leader Autonomous AI Database in the same region, that is required when local Autonomous Data Guard is enabled for a dedicated resource pool member using the parameter `isLocalDataGuardEnabled`. This field applies only to dedicated resource pool members, and the specified leader must be different from the primary\u2019s leader. Local Autonomous Data Guard can be enabled only if more than one dedicated resource pool exists in the region.""") -@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('--opc-dry-run', type=click.BOOL, help=u"""Indicates that the request is a dry run, if set to \"true\". A dry run request does not actually creating or updating a resource and is used only to perform validation on the submitted data.""") -@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) -@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING", "RECREATING", "ROLE_CHANGE_IN_PROGRESS", "UPGRADING", "INACCESSIBLE", "STANDBY", "TRANSPORTING"]), 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 PROVISIONING --wait-for-state TRANSPORTING 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({'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'}}) -@cli_util.help_option -@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, 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') - if not force: - if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details: - if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details 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 - if opc_dry_run is not None: - kwargs['opc_dry_run'] = opc_dry_run - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['encryptionKey'] = {} - _details['encryptionKey']['vaultUri'] = encryption_key_vault_uri - _details['encryptionKey']['keyName'] = encryption_key_key_name - - if backup_retention_period_in_days is not None: - _details['backupRetentionPeriodInDays'] = backup_retention_period_in_days - - if compute_model is not None: - _details['computeModel'] = compute_model - - if in_memory_percentage is not None: - _details['inMemoryPercentage'] = in_memory_percentage - - if local_adg_auto_failover_max_data_loss_limit is not None: - _details['localAdgAutoFailoverMaxDataLossLimit'] = local_adg_auto_failover_max_data_loss_limit - - if cpu_core_count is not None: - _details['cpuCoreCount'] = cpu_core_count - - if long_term_backup_schedule is not None: - _details['longTermBackupSchedule'] = cli_util.parse_json_parameter("long_term_backup_schedule", long_term_backup_schedule) - - if is_dev_tier is not None: - _details['isDevTier'] = is_dev_tier - - if compute_count is not None: - _details['computeCount'] = compute_count - - if ocpu_count is not None: - _details['ocpuCount'] = ocpu_count - - if data_storage_size_in_tbs is not None: - _details['dataStorageSizeInTBs'] = data_storage_size_in_tbs - - if data_storage_size_in_gbs is not None: - _details['dataStorageSizeInGBs'] = data_storage_size_in_gbs - - if display_name is not None: - _details['displayName'] = display_name - - 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 - - if db_name is not None: - _details['dbName'] = db_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) - - if security_attributes is not None: - _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) - - if db_workload is not None: - _details['dbWorkload'] = db_workload - - if license_model is not None: - _details['licenseModel'] = license_model - - if byol_compute_count_limit is not None: - _details['byolComputeCountLimit'] = byol_compute_count_limit - - if is_access_control_enabled is not None: - _details['isAccessControlEnabled'] = is_access_control_enabled - - if whitelisted_ips is not None: - _details['whitelistedIps'] = cli_util.parse_json_parameter("whitelisted_ips", whitelisted_ips) - - if are_primary_whitelisted_ips_used is not None: - _details['arePrimaryWhitelistedIpsUsed'] = are_primary_whitelisted_ips_used - - if standby_whitelisted_ips is not None: - _details['standbyWhitelistedIps'] = cli_util.parse_json_parameter("standby_whitelisted_ips", standby_whitelisted_ips) - - if is_auto_scaling_enabled is not None: - _details['isAutoScalingEnabled'] = is_auto_scaling_enabled - - if is_refreshable_clone is not None: - _details['isRefreshableClone'] = is_refreshable_clone - - if refreshable_mode is not None: - _details['refreshableMode'] = refreshable_mode - - if is_local_data_guard_enabled is not None: - _details['isLocalDataGuardEnabled'] = is_local_data_guard_enabled - - if is_data_guard_enabled is not None: - _details['isDataGuardEnabled'] = is_data_guard_enabled - - if peer_db_id is not None: - _details['peerDbId'] = peer_db_id - - if db_version is not None: - _details['dbVersion'] = db_version - - if open_mode is not None: - _details['openMode'] = open_mode - - if permission_level is not None: - _details['permissionLevel'] = permission_level - - if subnet_id is not None: - _details['subnetId'] = subnet_id - - if private_endpoint_label is not None: - _details['privateEndpointLabel'] = private_endpoint_label - - if private_endpoint_ip is not None: - _details['privateEndpointIp'] = private_endpoint_ip - - if nsg_ids is not None: - _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids) - - if auto_refresh_frequency_in_seconds is not None: - _details['autoRefreshFrequencyInSeconds'] = auto_refresh_frequency_in_seconds - - if auto_refresh_point_lag_in_seconds is not None: - _details['autoRefreshPointLagInSeconds'] = auto_refresh_point_lag_in_seconds - - if time_of_auto_refresh_start is not None: - _details['timeOfAutoRefreshStart'] = time_of_auto_refresh_start - - if customer_contacts is not None: - _details['customerContacts'] = cli_util.parse_json_parameter("customer_contacts", customer_contacts) - - if is_mtls_connection_required is not None: - _details['isMtlsConnectionRequired'] = is_mtls_connection_required - - if resource_pool_leader_id is not None: - _details['resourcePoolLeaderId'] = resource_pool_leader_id - - if resource_pool_summary is not None: - _details['resourcePoolSummary'] = cli_util.parse_json_parameter("resource_pool_summary", resource_pool_summary) - - if autonomous_maintenance_schedule_type is not None: - _details['autonomousMaintenanceScheduleType'] = autonomous_maintenance_schedule_type - - if autonomous_database_maintenance_window is not None: - _details['autonomousDatabaseMaintenanceWindow'] = cli_util.parse_json_parameter("autonomous_database_maintenance_window", autonomous_database_maintenance_window) - - if time_maintenance_pause_until is not None: - _details['timeMaintenancePauseUntil'] = time_maintenance_pause_until - - if is_backup_retention_locked is not None: - _details['isBackupRetentionLocked'] = is_backup_retention_locked - - if time_scheduled_db_version_upgrade is not None: - _details['timeScheduledDbVersionUpgrade'] = time_scheduled_db_version_upgrade - - if is_disable_db_version_upgrade_schedule is not None: - _details['isDisableDbVersionUpgradeSchedule'] = is_disable_db_version_upgrade_schedule - - if is_schedule_db_version_upgrade_to_earliest is not None: - _details['isScheduleDbVersionUpgradeToEarliest'] = is_schedule_db_version_upgrade_to_earliest - - if scheduled_operations is not None: - _details['scheduledOperations'] = cli_util.parse_json_parameter("scheduled_operations", scheduled_operations) - - if is_auto_scaling_for_storage_enabled is not None: - _details['isAutoScalingForStorageEnabled'] = is_auto_scaling_for_storage_enabled - - if database_edition is not None: - _details['databaseEdition'] = database_edition - - if db_tools_details is not None: - _details['dbToolsDetails'] = cli_util.parse_json_parameter("db_tools_details", db_tools_details) - - if vanity_url_details is not None: - _details['vanityUrlDetails'] = cli_util.parse_json_parameter("vanity_url_details", vanity_url_details) - - if secret_id is not None: - _details['secretId'] = secret_id - - if secret_version_number is not None: - _details['secretVersionNumber'] = secret_version_number - - if is_disconnect_peer is not None: - _details['isDisconnectPeer'] = is_disconnect_peer - - if local_adg_resource_pool_leader_id is not None: - _details['localAdgResourcePoolLeaderId'] = local_adg_resource_pool_leader_id - - _details['encryptionKey']['provider'] = 'AZURE' - - client = cli_util.build_client('database', 'database', ctx) - result = client.update_autonomous_database( - autonomous_database_id=autonomous_database_id, - update_autonomous_database_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_autonomous_database') and callable(getattr(client, 'get_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_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) - - -@autonomous_database_group.command(name=cli_util.override('db.update_autonomous_database_aws_key_details.command_name', 'update-autonomous-database-aws-key-details'), help=u"""Updates one or more attributes of the specified Autonomous AI Database. See the UpdateAutonomousDatabaseDetails resource for a full list of attributes that can be updated. \n[Command Reference](updateAutonomousDatabase)""") -@cli_util.option('--autonomous-database-id', required=True, help=u"""The database [OCID].""") -@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('--backup-retention-period-in-days', type=click.INT, help=u"""Retention period, in days, for long-term backups""") -@cli_util.option('--compute-model', type=custom_types.CliCaseInsensitiveChoice(["ECPU", "OCPU"]), help=u"""The compute model of the Autonomous AI Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ECPU compute model is the recommended model and OCPU compute model is legacy.""") -@cli_util.option('--in-memory-percentage', type=click.INT, help=u"""The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous AI Database. This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform.""") -@cli_util.option('--local-adg-auto-failover-max-data-loss-limit', type=click.INT, help=u"""Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard""") -@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPUs to be made available to the Autonomous AI Database.
For Autonomous AI Databases on Dedicated Exadata Infrastructure: - The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. - It is suggested to use 'computeCount' parameter if you want to use fractional value to provision less than 1 core. - -**Note:** This parameter cannot be used with the `ocpuCount` or `computeCount` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--long-term-backup-schedule', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-dev-tier', type=click.BOOL, help=u"""Autonomous AI Database for Developers are fixed-shape Autonomous AI Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database.""") -@cli_util.option('--compute-count', type=click.FLOAT, help=u"""The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous AI Database Serverless instance or an Autonomous AI Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--ocpu-count', type=click.FLOAT, help=u"""The number of OCPU cores to be made available to the Autonomous AI Database. - -For Autonomous AI Databases on Dedicated Exadata Infrastructure, you can specify a fractional value for this parameter. Fractional values are not supported for Autonomous AI Database Serverless instances. For Autonomous AI Database Serverless instances, this parameter is not used. - -To provision less than 1 core, enter a fractional value in an increment of 0.1. To provision 1 or more cores, you must enter an integer between 1 and the maximum number of cores available to the infrastructure shape. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. Likewise, you can provision 2 cores or 3 cores, but not 2.5 cores. The maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") -@cli_util.option('--data-storage-size-in-tbs', type=click.INT, help=u"""The size, in terabytes, of the data volume that will be created and attached to the database. For Autonomous AI Databases on dedicated Exadata infrastructure, the maximum storage value is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. A full Exadata service is allocated when the Autonomous AI Database size is set to the upper limit (384 TB). - -**Note:** This parameter cannot be used with the `dataStorageSizeInGBs` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--data-storage-size-in-gbs', type=click.INT, help=u"""Applies to dedicated Exadata infrastructure only. - -The size, in gigabytes, of the data volume that will be created and attached to the database. The maximum storage value depends on the system shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `dataStorageSizeInTBs` parameter.""") -@cli_util.option('--display-name', help=u"""The user-friendly name for the Autonomous AI Database. The name does not have to be unique. The display name can only be updated for Autonomous AI Databases using dedicated Exadata Infrastructure. This parameter may not be updated in parallel with dbVersion.""") -@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). - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, or isFreeTier.""") -@cli_util.option('--db-name', help=u"""New name for this Autonomous AI Database. For Autonomous AI Databases on Dedicated Exadata Infrastructure, the name must begin with an alphabetic character, and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. For Autonomous AI Database Serverless instances, the name must begin with an alphabetic character, and can contain a maximum of 30 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails.""") -@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].""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Security Attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Oracle-ZPR\": {\"MaxEgressCount\": {\"value\": \"42\", \"mode\": \"audit\"}}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--db-workload', type=custom_types.CliCaseInsensitiveChoice(["OLTP", "DW", "AJD", "APEX", "LH"]), help=u"""The Autonomous AI Database workload type. The following values are valid: - OLTP - indicates an Autonomous AI Transaction Processing database - DW - indicates an Autonomous AI Lakehouse database - AJD - indicates an Autonomous AI JSON Database - APEX - indicates an Autonomous AI Database with the Oracle APEX AI Application Development workload type. - LH - indicates an Oracle Autonomous AI Lakehouse database - -**Note** Starting December 2026, DW will not be supported as a valid value for this parameter. When creating an Autonomous AI Database, if this parameter is not specified, the default value is `OLTP`. - - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--license-model', type=custom_types.CliCaseInsensitiveChoice(["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"]), help=u"""The Oracle license model that applies to the Oracle Autonomous AI Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle AI Database software licenses and the Oracle AI Database service. Note that when provisioning an [Autonomous AI Database on dedicated Exadata infrastructure], this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous AI Database Serverless] database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--byol-compute-count-limit', type=click.FLOAT, help=u"""The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed.""") -@cli_util.option('--is-access-control-enabled', type=click.BOOL, help=u"""Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - -This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform. For Autonomous AI Database Serverless instances, `whitelistedIps` is used.""") -@cli_util.option('--whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--are-primary-whitelisted-ips-used', type=click.BOOL, help=u"""This field will be null if the Autonomous AI Database is not Data Guard enabled or Access Control is disabled. `TRUE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses the primary's IP access control list (ACL) for standby. `FALSE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses a different IP access control list (ACL) for standby compared to primary.""") -@cli_util.option('--standby-whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates whether auto scaling is enabled for the Autonomous AI Database CPU core count. Setting to `TRUE` enables auto scaling. Setting to `FALSE` disables auto scaling. The default value is `TRUE`. Auto scaling is only available for [Autonomous AI Database Serverless instances].""") -@cli_util.option('--is-refreshable-clone', type=click.BOOL, help=u"""Indicates if the Autonomous AI Database is a refreshable clone. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--refreshable-mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "MANUAL"]), help=u"""The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous AI Database.""") -@cli_util.option('--is-local-data-guard-enabled', type=click.BOOL, help=u"""Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -This cannot be updated in parallel with any of the following: isMTLSRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--is-data-guard-enabled', type=click.BOOL, help=u"""** Deprecated. ** Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -To delete a cross-region standby database, provide the `peerDbId` for the standby database in a remote region, and set `isDataGuardEnabled` to `FALSE`.""") -@cli_util.option('--peer-db-id', help=u"""The database OCID(/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. - -To create or delete a local (in-region) standby, see the `isDataGuardEnabled` parameter. - -When disconnecting a cross-region standby, specify the standby database OCID in this parameter together with `isDisconnectPeer=true`.""") -@cli_util.option('--db-version', help=u"""A valid Oracle AI Database version for Autonomous AI Database. When you specify 23ai for dbversion, the system will provision a 23ai database, but the UI will display it as 26ai. When you specify 26ai for dbversion, the system will provision and display a 26ai database as expected. For new databases, it is recommended to use either 19c or 26ai. - -**Note** Starting December 2026, 23ai will not be supported as a valid value for this parameter.""") -@cli_util.option('--open-mode', type=custom_types.CliCaseInsensitiveChoice(["READ_ONLY", "READ_WRITE"]), help=u"""Indicates the Autonomous AI Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--permission-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "UNRESTRICTED"]), help=u"""The Autonomous AI Database permission level. Restricted mode allows access only by admin users. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet the resource is associated with. - -**Subnet Restrictions:** - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. - For Autonomous AI Database, setting this will disable public secure access to the database. - -These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet.""") -@cli_util.option('--private-endpoint-label', help=u"""The resource's private endpoint label. - Setting the endpoint label to a non-empty string creates a private endpoint database. - Resetting the endpoint label to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. - Setting the endpoint label to a non-empty string value, updates to a new private endpoint database, when the database is disabled and re-enabled. - -This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--private-endpoint-ip', help=u"""The private endpoint Ip address for the resource.""") -@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of [OCIDs] for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules]. **NsgIds restrictions:** - A network security group (NSG) is optional for Autonomous AI Databases with private access. The nsgIds list can be empty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--auto-refresh-frequency-in-seconds', type=click.INT, help=u"""The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter.""") -@cli_util.option('--auto-refresh-point-lag-in-seconds', type=click.INT, help=u"""The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens.""") -@cli_util.option('--time-of-auto-refresh-start', type=custom_types.CLI_DATETIME, help=u"""The the date and time that auto-refreshing will begin for an Autonomous AI Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--customer-contacts', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Customer Contacts. Setting this to an empty list removes all customer contacts of an Oracle - -This cannot be updated in parallel with any of the following: isMTLSConnectionRequired, scheduledOperations, or dbToolsDetails. - -This option is a JSON list with items of type CustomerContact. For documentation on CustomerContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/CustomerContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-mtls-connection-required', type=click.BOOL, help=u"""Specifies if the Autonomous AI Database requires mTLS connections. - -This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: - CreateAutonomousDatabase - GetAutonomousDatabase - UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous AI Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true.""") -@cli_util.option('--resource-pool-leader-id', help=u"""The unique identifier for leader Autonomous AI Database OCID [OCID].""") -@cli_util.option('--resource-pool-summary', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--autonomous-maintenance-schedule-type', type=custom_types.CliCaseInsensitiveChoice(["EARLY", "REGULAR"]), help=u"""The maintenance schedule type of the Autonomous AI Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle""") -@cli_util.option('--autonomous-database-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--time-maintenance-pause-until', type=custom_types.CLI_DATETIME, help=u"""The date until which Autonomous AI Database maintenance is temporarily paused.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-backup-retention-locked', type=click.BOOL, help=u"""True if the Autonomous AI Database is backup retention locked.""") -@cli_util.option('--time-scheduled-db-version-upgrade', type=custom_types.CLI_DATETIME, help=u"""The date and time the Autonomous AI Database scheduled to upgrade to 26ai.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-disable-db-version-upgrade-schedule', type=click.BOOL, help=u"""True if user wants to disable Autonomous AI Database scheduled upgrade to 26ai.""") -@cli_util.option('--is-schedule-db-version-upgrade-to-earliest', type=click.BOOL, help=u"""True if user wants to schedule Autonomous AI Database upgrade to the earliest available time.""") -@cli_util.option('--scheduled-operations', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type ScheduledOperationDetails. For documentation on ScheduledOperationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ScheduledOperationDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-for-storage-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Autonomous AI Database storage. The default value is `FALSE`.""") -@cli_util.option('--database-edition', help=u"""The Oracle AI Database Edition that applies to the Autonomous AI Databases. This parameter accepts options `STANDARD_EDITION` and `ENTERPRISE_EDITION`. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--db-tools-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database tools details. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type DatabaseTool. For documentation on DatabaseTool please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/DatabaseTool.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--vanity-url-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--secret-id', help=u"""The OCI vault secret [/Content/General/Concepts/identifiers.htm]OCID. This cannot be used in conjunction with adminPassword.""") -@cli_util.option('--secret-version-number', type=click.INT, help=u"""The version of the vault secret. If no version is specified, the latest version will be used.""") -@cli_util.option('--is-disconnect-peer', type=click.BOOL, help=u"""If true, this disconnects the Autonomous AI Database from its peer. After the disconnect completes, the Autonomous AI Database works permanently as a standalone database. - -**Warning:** A disconnected standby is no longer part of the disaster recovery configuration. Operations and restrictions that apply to a connected standby do not apply in the same way after the database has been disconnected. - -To disconnect a cross region standby, also provide the OCID of the standby database in the `peerDbId` parameter.""") -@cli_util.option('--local-adg-resource-pool-leader-id', help=u"""The [OCID] of a dedicated resource pool leader Autonomous AI Database in the same region, that is required when local Autonomous Data Guard is enabled for a dedicated resource pool member using the parameter `isLocalDataGuardEnabled`. This field applies only to dedicated resource pool members, and the specified leader must be different from the primary\u2019s leader. Local Autonomous Data Guard can be enabled only if more than one dedicated resource pool exists in the region.""") -@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('--opc-dry-run', type=click.BOOL, help=u"""Indicates that the request is a dry run, if set to \"true\". A dry run request does not actually creating or updating a resource and is used only to perform validation on the submitted data.""") -@cli_util.option('--encryption-key-arn-role', help=u"""AWS ARN role""") -@cli_util.option('--encryption-key-external-id', help=u"""AWS external ID""") -@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) -@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING", "RECREATING", "ROLE_CHANGE_IN_PROGRESS", "UPGRADING", "INACCESSIBLE", "STANDBY", "TRANSPORTING"]), 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 PROVISIONING --wait-for-state TRANSPORTING 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({'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'}}) -@cli_util.help_option -@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, 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') - if not force: - if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details: - if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details 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 - if opc_dry_run is not None: - kwargs['opc_dry_run'] = opc_dry_run - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['encryptionKey'] = {} - _details['encryptionKey']['serviceEndpointUri'] = encryption_key_service_endpoint_uri - _details['encryptionKey']['keyArn'] = encryption_key_key_arn - - if backup_retention_period_in_days is not None: - _details['backupRetentionPeriodInDays'] = backup_retention_period_in_days - - if compute_model is not None: - _details['computeModel'] = compute_model - - if in_memory_percentage is not None: - _details['inMemoryPercentage'] = in_memory_percentage - - if local_adg_auto_failover_max_data_loss_limit is not None: - _details['localAdgAutoFailoverMaxDataLossLimit'] = local_adg_auto_failover_max_data_loss_limit - - if cpu_core_count is not None: - _details['cpuCoreCount'] = cpu_core_count - - if long_term_backup_schedule is not None: - _details['longTermBackupSchedule'] = cli_util.parse_json_parameter("long_term_backup_schedule", long_term_backup_schedule) - - if is_dev_tier is not None: - _details['isDevTier'] = is_dev_tier - - if compute_count is not None: - _details['computeCount'] = compute_count - - if ocpu_count is not None: - _details['ocpuCount'] = ocpu_count - - if data_storage_size_in_tbs is not None: - _details['dataStorageSizeInTBs'] = data_storage_size_in_tbs - - if data_storage_size_in_gbs is not None: - _details['dataStorageSizeInGBs'] = data_storage_size_in_gbs - - if display_name is not None: - _details['displayName'] = display_name - - 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 - - if db_name is not None: - _details['dbName'] = db_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) - - if security_attributes is not None: - _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) - - if db_workload is not None: - _details['dbWorkload'] = db_workload - - if license_model is not None: - _details['licenseModel'] = license_model - - if byol_compute_count_limit is not None: - _details['byolComputeCountLimit'] = byol_compute_count_limit - - if is_access_control_enabled is not None: - _details['isAccessControlEnabled'] = is_access_control_enabled - - if whitelisted_ips is not None: - _details['whitelistedIps'] = cli_util.parse_json_parameter("whitelisted_ips", whitelisted_ips) - - if are_primary_whitelisted_ips_used is not None: - _details['arePrimaryWhitelistedIpsUsed'] = are_primary_whitelisted_ips_used - - if standby_whitelisted_ips is not None: - _details['standbyWhitelistedIps'] = cli_util.parse_json_parameter("standby_whitelisted_ips", standby_whitelisted_ips) - - if is_auto_scaling_enabled is not None: - _details['isAutoScalingEnabled'] = is_auto_scaling_enabled - - if is_refreshable_clone is not None: - _details['isRefreshableClone'] = is_refreshable_clone - - if refreshable_mode is not None: - _details['refreshableMode'] = refreshable_mode - - if is_local_data_guard_enabled is not None: - _details['isLocalDataGuardEnabled'] = is_local_data_guard_enabled - - if is_data_guard_enabled is not None: - _details['isDataGuardEnabled'] = is_data_guard_enabled - - if peer_db_id is not None: - _details['peerDbId'] = peer_db_id - - if db_version is not None: - _details['dbVersion'] = db_version - - if open_mode is not None: - _details['openMode'] = open_mode - - if permission_level is not None: - _details['permissionLevel'] = permission_level - - if subnet_id is not None: - _details['subnetId'] = subnet_id - - if private_endpoint_label is not None: - _details['privateEndpointLabel'] = private_endpoint_label - - if private_endpoint_ip is not None: - _details['privateEndpointIp'] = private_endpoint_ip - - if nsg_ids is not None: - _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids) - - if auto_refresh_frequency_in_seconds is not None: - _details['autoRefreshFrequencyInSeconds'] = auto_refresh_frequency_in_seconds - - if auto_refresh_point_lag_in_seconds is not None: - _details['autoRefreshPointLagInSeconds'] = auto_refresh_point_lag_in_seconds - - if time_of_auto_refresh_start is not None: - _details['timeOfAutoRefreshStart'] = time_of_auto_refresh_start - - if customer_contacts is not None: - _details['customerContacts'] = cli_util.parse_json_parameter("customer_contacts", customer_contacts) - - if is_mtls_connection_required is not None: - _details['isMtlsConnectionRequired'] = is_mtls_connection_required - - if resource_pool_leader_id is not None: - _details['resourcePoolLeaderId'] = resource_pool_leader_id - - if resource_pool_summary is not None: - _details['resourcePoolSummary'] = cli_util.parse_json_parameter("resource_pool_summary", resource_pool_summary) - - if autonomous_maintenance_schedule_type is not None: - _details['autonomousMaintenanceScheduleType'] = autonomous_maintenance_schedule_type - - if autonomous_database_maintenance_window is not None: - _details['autonomousDatabaseMaintenanceWindow'] = cli_util.parse_json_parameter("autonomous_database_maintenance_window", autonomous_database_maintenance_window) - - if time_maintenance_pause_until is not None: - _details['timeMaintenancePauseUntil'] = time_maintenance_pause_until - - if is_backup_retention_locked is not None: - _details['isBackupRetentionLocked'] = is_backup_retention_locked - - if time_scheduled_db_version_upgrade is not None: - _details['timeScheduledDbVersionUpgrade'] = time_scheduled_db_version_upgrade - - if is_disable_db_version_upgrade_schedule is not None: - _details['isDisableDbVersionUpgradeSchedule'] = is_disable_db_version_upgrade_schedule - - if is_schedule_db_version_upgrade_to_earliest is not None: - _details['isScheduleDbVersionUpgradeToEarliest'] = is_schedule_db_version_upgrade_to_earliest - - if scheduled_operations is not None: - _details['scheduledOperations'] = cli_util.parse_json_parameter("scheduled_operations", scheduled_operations) - - if is_auto_scaling_for_storage_enabled is not None: - _details['isAutoScalingForStorageEnabled'] = is_auto_scaling_for_storage_enabled - - if database_edition is not None: - _details['databaseEdition'] = database_edition - - if db_tools_details is not None: - _details['dbToolsDetails'] = cli_util.parse_json_parameter("db_tools_details", db_tools_details) - - if vanity_url_details is not None: - _details['vanityUrlDetails'] = cli_util.parse_json_parameter("vanity_url_details", vanity_url_details) - - if secret_id is not None: - _details['secretId'] = secret_id - - if secret_version_number is not None: - _details['secretVersionNumber'] = secret_version_number - - if is_disconnect_peer is not None: - _details['isDisconnectPeer'] = is_disconnect_peer - - if local_adg_resource_pool_leader_id is not None: - _details['localAdgResourcePoolLeaderId'] = local_adg_resource_pool_leader_id - - if encryption_key_arn_role is not None: - _details['encryptionKey']['arnRole'] = encryption_key_arn_role - - if encryption_key_external_id is not None: - _details['encryptionKey']['externalId'] = encryption_key_external_id - - _details['encryptionKey']['provider'] = 'AWS' - - client = cli_util.build_client('database', 'database', ctx) - result = client.update_autonomous_database( - autonomous_database_id=autonomous_database_id, - update_autonomous_database_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_autonomous_database') and callable(getattr(client, 'get_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_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) - - -@autonomous_database_group.command(name=cli_util.override('db.update_autonomous_database_oci_key_details.command_name', 'update-autonomous-database-oci-key-details'), help=u"""Updates one or more attributes of the specified Autonomous AI Database. See the UpdateAutonomousDatabaseDetails resource for a full list of attributes that can be updated. \n[Command Reference](updateAutonomousDatabase)""") -@cli_util.option('--autonomous-database-id', required=True, help=u"""The database [OCID].""") -@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('--backup-retention-period-in-days', type=click.INT, help=u"""Retention period, in days, for long-term backups""") -@cli_util.option('--compute-model', type=custom_types.CliCaseInsensitiveChoice(["ECPU", "OCPU"]), help=u"""The compute model of the Autonomous AI Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ECPU compute model is the recommended model and OCPU compute model is legacy.""") -@cli_util.option('--in-memory-percentage', type=click.INT, help=u"""The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous AI Database. This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform.""") -@cli_util.option('--local-adg-auto-failover-max-data-loss-limit', type=click.INT, help=u"""Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard""") -@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPUs to be made available to the Autonomous AI Database.
For Autonomous AI Databases on Dedicated Exadata Infrastructure: - The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. - It is suggested to use 'computeCount' parameter if you want to use fractional value to provision less than 1 core. - -**Note:** This parameter cannot be used with the `ocpuCount` or `computeCount` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--long-term-backup-schedule', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-dev-tier', type=click.BOOL, help=u"""Autonomous AI Database for Developers are fixed-shape Autonomous AI Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database.""") -@cli_util.option('--compute-count', type=click.FLOAT, help=u"""The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous AI Database Serverless instance or an Autonomous AI Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--ocpu-count', type=click.FLOAT, help=u"""The number of OCPU cores to be made available to the Autonomous AI Database. - -For Autonomous AI Databases on Dedicated Exadata Infrastructure, you can specify a fractional value for this parameter. Fractional values are not supported for Autonomous AI Database Serverless instances. For Autonomous AI Database Serverless instances, this parameter is not used. - -To provision less than 1 core, enter a fractional value in an increment of 0.1. To provision 1 or more cores, you must enter an integer between 1 and the maximum number of cores available to the infrastructure shape. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. Likewise, you can provision 2 cores or 3 cores, but not 2.5 cores. The maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") -@cli_util.option('--data-storage-size-in-tbs', type=click.INT, help=u"""The size, in terabytes, of the data volume that will be created and attached to the database. For Autonomous AI Databases on dedicated Exadata infrastructure, the maximum storage value is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. A full Exadata service is allocated when the Autonomous AI Database size is set to the upper limit (384 TB). - -**Note:** This parameter cannot be used with the `dataStorageSizeInGBs` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--data-storage-size-in-gbs', type=click.INT, help=u"""Applies to dedicated Exadata infrastructure only. - -The size, in gigabytes, of the data volume that will be created and attached to the database. The maximum storage value depends on the system shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `dataStorageSizeInTBs` parameter.""") -@cli_util.option('--display-name', help=u"""The user-friendly name for the Autonomous AI Database. The name does not have to be unique. The display name can only be updated for Autonomous AI Databases using dedicated Exadata Infrastructure. This parameter may not be updated in parallel with dbVersion.""") -@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). - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, or isFreeTier.""") -@cli_util.option('--db-name', help=u"""New name for this Autonomous AI Database. For Autonomous AI Databases on Dedicated Exadata Infrastructure, the name must begin with an alphabetic character, and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. For Autonomous AI Database Serverless instances, the name must begin with an alphabetic character, and can contain a maximum of 30 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails.""") -@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].""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Security Attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Oracle-ZPR\": {\"MaxEgressCount\": {\"value\": \"42\", \"mode\": \"audit\"}}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--db-workload', type=custom_types.CliCaseInsensitiveChoice(["OLTP", "DW", "AJD", "APEX", "LH"]), help=u"""The Autonomous AI Database workload type. The following values are valid: - OLTP - indicates an Autonomous AI Transaction Processing database - DW - indicates an Autonomous AI Lakehouse database - AJD - indicates an Autonomous AI JSON Database - APEX - indicates an Autonomous AI Database with the Oracle APEX AI Application Development workload type. - LH - indicates an Oracle Autonomous AI Lakehouse database - -**Note** Starting December 2026, DW will not be supported as a valid value for this parameter. When creating an Autonomous AI Database, if this parameter is not specified, the default value is `OLTP`. - - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--license-model', type=custom_types.CliCaseInsensitiveChoice(["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"]), help=u"""The Oracle license model that applies to the Oracle Autonomous AI Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle AI Database software licenses and the Oracle AI Database service. Note that when provisioning an [Autonomous AI Database on dedicated Exadata infrastructure], this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous AI Database Serverless] database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--byol-compute-count-limit', type=click.FLOAT, help=u"""The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed.""") -@cli_util.option('--is-access-control-enabled', type=click.BOOL, help=u"""Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - -This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform. For Autonomous AI Database Serverless instances, `whitelistedIps` is used.""") -@cli_util.option('--whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--are-primary-whitelisted-ips-used', type=click.BOOL, help=u"""This field will be null if the Autonomous AI Database is not Data Guard enabled or Access Control is disabled. `TRUE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses the primary's IP access control list (ACL) for standby. `FALSE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses a different IP access control list (ACL) for standby compared to primary.""") -@cli_util.option('--standby-whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates whether auto scaling is enabled for the Autonomous AI Database CPU core count. Setting to `TRUE` enables auto scaling. Setting to `FALSE` disables auto scaling. The default value is `TRUE`. Auto scaling is only available for [Autonomous AI Database Serverless instances].""") -@cli_util.option('--is-refreshable-clone', type=click.BOOL, help=u"""Indicates if the Autonomous AI Database is a refreshable clone. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--refreshable-mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "MANUAL"]), help=u"""The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous AI Database.""") -@cli_util.option('--is-local-data-guard-enabled', type=click.BOOL, help=u"""Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -This cannot be updated in parallel with any of the following: isMTLSRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--is-data-guard-enabled', type=click.BOOL, help=u"""** Deprecated. ** Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -To delete a cross-region standby database, provide the `peerDbId` for the standby database in a remote region, and set `isDataGuardEnabled` to `FALSE`.""") -@cli_util.option('--peer-db-id', help=u"""The database OCID(/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. - -To create or delete a local (in-region) standby, see the `isDataGuardEnabled` parameter. - -When disconnecting a cross-region standby, specify the standby database OCID in this parameter together with `isDisconnectPeer=true`.""") -@cli_util.option('--db-version', help=u"""A valid Oracle AI Database version for Autonomous AI Database. When you specify 23ai for dbversion, the system will provision a 23ai database, but the UI will display it as 26ai. When you specify 26ai for dbversion, the system will provision and display a 26ai database as expected. For new databases, it is recommended to use either 19c or 26ai. - -**Note** Starting December 2026, 23ai will not be supported as a valid value for this parameter.""") -@cli_util.option('--open-mode', type=custom_types.CliCaseInsensitiveChoice(["READ_ONLY", "READ_WRITE"]), help=u"""Indicates the Autonomous AI Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--permission-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "UNRESTRICTED"]), help=u"""The Autonomous AI Database permission level. Restricted mode allows access only by admin users. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet the resource is associated with. - -**Subnet Restrictions:** - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. - For Autonomous AI Database, setting this will disable public secure access to the database. - -These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet.""") -@cli_util.option('--private-endpoint-label', help=u"""The resource's private endpoint label. - Setting the endpoint label to a non-empty string creates a private endpoint database. - Resetting the endpoint label to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. - Setting the endpoint label to a non-empty string value, updates to a new private endpoint database, when the database is disabled and re-enabled. - -This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--private-endpoint-ip', help=u"""The private endpoint Ip address for the resource.""") -@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of [OCIDs] for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules]. **NsgIds restrictions:** - A network security group (NSG) is optional for Autonomous AI Databases with private access. The nsgIds list can be empty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--auto-refresh-frequency-in-seconds', type=click.INT, help=u"""The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter.""") -@cli_util.option('--auto-refresh-point-lag-in-seconds', type=click.INT, help=u"""The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens.""") -@cli_util.option('--time-of-auto-refresh-start', type=custom_types.CLI_DATETIME, help=u"""The the date and time that auto-refreshing will begin for an Autonomous AI Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--customer-contacts', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Customer Contacts. Setting this to an empty list removes all customer contacts of an Oracle - -This cannot be updated in parallel with any of the following: isMTLSConnectionRequired, scheduledOperations, or dbToolsDetails. - -This option is a JSON list with items of type CustomerContact. For documentation on CustomerContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/CustomerContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-mtls-connection-required', type=click.BOOL, help=u"""Specifies if the Autonomous AI Database requires mTLS connections. - -This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: - CreateAutonomousDatabase - GetAutonomousDatabase - UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous AI Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true.""") -@cli_util.option('--resource-pool-leader-id', help=u"""The unique identifier for leader Autonomous AI Database OCID [OCID].""") -@cli_util.option('--resource-pool-summary', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--autonomous-maintenance-schedule-type', type=custom_types.CliCaseInsensitiveChoice(["EARLY", "REGULAR"]), help=u"""The maintenance schedule type of the Autonomous AI Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle""") -@cli_util.option('--autonomous-database-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--time-maintenance-pause-until', type=custom_types.CLI_DATETIME, help=u"""The date until which Autonomous AI Database maintenance is temporarily paused.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-backup-retention-locked', type=click.BOOL, help=u"""True if the Autonomous AI Database is backup retention locked.""") -@cli_util.option('--time-scheduled-db-version-upgrade', type=custom_types.CLI_DATETIME, help=u"""The date and time the Autonomous AI Database scheduled to upgrade to 26ai.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-disable-db-version-upgrade-schedule', type=click.BOOL, help=u"""True if user wants to disable Autonomous AI Database scheduled upgrade to 26ai.""") -@cli_util.option('--is-schedule-db-version-upgrade-to-earliest', type=click.BOOL, help=u"""True if user wants to schedule Autonomous AI Database upgrade to the earliest available time.""") -@cli_util.option('--scheduled-operations', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type ScheduledOperationDetails. For documentation on ScheduledOperationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ScheduledOperationDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-for-storage-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Autonomous AI Database storage. The default value is `FALSE`.""") -@cli_util.option('--database-edition', help=u"""The Oracle AI Database Edition that applies to the Autonomous AI Databases. This parameter accepts options `STANDARD_EDITION` and `ENTERPRISE_EDITION`. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--db-tools-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database tools details. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type DatabaseTool. For documentation on DatabaseTool please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/DatabaseTool.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--vanity-url-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--secret-id', help=u"""The OCI vault secret [/Content/General/Concepts/identifiers.htm]OCID. This cannot be used in conjunction with adminPassword.""") -@cli_util.option('--secret-version-number', type=click.INT, help=u"""The version of the vault secret. If no version is specified, the latest version will be used.""") -@cli_util.option('--is-disconnect-peer', type=click.BOOL, help=u"""If true, this disconnects the Autonomous AI Database from its peer. After the disconnect completes, the Autonomous AI Database works permanently as a standalone database. - -**Warning:** A disconnected standby is no longer part of the disaster recovery configuration. Operations and restrictions that apply to a connected standby do not apply in the same way after the database has been disconnected. - -To disconnect a cross region standby, also provide the OCID of the standby database in the `peerDbId` parameter.""") -@cli_util.option('--local-adg-resource-pool-leader-id', help=u"""The [OCID] of a dedicated resource pool leader Autonomous AI Database in the same region, that is required when local Autonomous Data Guard is enabled for a dedicated resource pool member using the parameter `isLocalDataGuardEnabled`. This field applies only to dedicated resource pool members, and the specified leader must be different from the primary\u2019s leader. Local Autonomous Data Guard can be enabled only if more than one dedicated resource pool exists in the region.""") -@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('--opc-dry-run', type=click.BOOL, help=u"""Indicates that the request is a dry run, if set to \"true\". A dry run request does not actually creating or updating a resource and is used only to perform validation on the submitted data.""") -@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) -@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING", "RECREATING", "ROLE_CHANGE_IN_PROGRESS", "UPGRADING", "INACCESSIBLE", "STANDBY", "TRANSPORTING"]), 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 PROVISIONING --wait-for-state TRANSPORTING 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({'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'}}) -@cli_util.help_option -@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, 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') - if not force: - if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details: - if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details 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 - if opc_dry_run is not None: - kwargs['opc_dry_run'] = opc_dry_run - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['encryptionKey'] = {} - _details['encryptionKey']['kmsKeyId'] = encryption_key_kms_key_id - _details['encryptionKey']['vaultId'] = encryption_key_vault_id - - if backup_retention_period_in_days is not None: - _details['backupRetentionPeriodInDays'] = backup_retention_period_in_days - - if compute_model is not None: - _details['computeModel'] = compute_model - - if in_memory_percentage is not None: - _details['inMemoryPercentage'] = in_memory_percentage - - if local_adg_auto_failover_max_data_loss_limit is not None: - _details['localAdgAutoFailoverMaxDataLossLimit'] = local_adg_auto_failover_max_data_loss_limit - - if cpu_core_count is not None: - _details['cpuCoreCount'] = cpu_core_count - - if long_term_backup_schedule is not None: - _details['longTermBackupSchedule'] = cli_util.parse_json_parameter("long_term_backup_schedule", long_term_backup_schedule) - - if is_dev_tier is not None: - _details['isDevTier'] = is_dev_tier - - if compute_count is not None: - _details['computeCount'] = compute_count - - if ocpu_count is not None: - _details['ocpuCount'] = ocpu_count - - if data_storage_size_in_tbs is not None: - _details['dataStorageSizeInTBs'] = data_storage_size_in_tbs - - if data_storage_size_in_gbs is not None: - _details['dataStorageSizeInGBs'] = data_storage_size_in_gbs - - if display_name is not None: - _details['displayName'] = display_name - - 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 - - if db_name is not None: - _details['dbName'] = db_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) - - if security_attributes is not None: - _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) - - if db_workload is not None: - _details['dbWorkload'] = db_workload - - if license_model is not None: - _details['licenseModel'] = license_model - - if byol_compute_count_limit is not None: - _details['byolComputeCountLimit'] = byol_compute_count_limit - - if is_access_control_enabled is not None: - _details['isAccessControlEnabled'] = is_access_control_enabled - - if whitelisted_ips is not None: - _details['whitelistedIps'] = cli_util.parse_json_parameter("whitelisted_ips", whitelisted_ips) - - if are_primary_whitelisted_ips_used is not None: - _details['arePrimaryWhitelistedIpsUsed'] = are_primary_whitelisted_ips_used - - if standby_whitelisted_ips is not None: - _details['standbyWhitelistedIps'] = cli_util.parse_json_parameter("standby_whitelisted_ips", standby_whitelisted_ips) - - if is_auto_scaling_enabled is not None: - _details['isAutoScalingEnabled'] = is_auto_scaling_enabled - - if is_refreshable_clone is not None: - _details['isRefreshableClone'] = is_refreshable_clone - - if refreshable_mode is not None: - _details['refreshableMode'] = refreshable_mode - - if is_local_data_guard_enabled is not None: - _details['isLocalDataGuardEnabled'] = is_local_data_guard_enabled - - if is_data_guard_enabled is not None: - _details['isDataGuardEnabled'] = is_data_guard_enabled - - if peer_db_id is not None: - _details['peerDbId'] = peer_db_id - - if db_version is not None: - _details['dbVersion'] = db_version - - if open_mode is not None: - _details['openMode'] = open_mode - - if permission_level is not None: - _details['permissionLevel'] = permission_level - - if subnet_id is not None: - _details['subnetId'] = subnet_id - - if private_endpoint_label is not None: - _details['privateEndpointLabel'] = private_endpoint_label - - if private_endpoint_ip is not None: - _details['privateEndpointIp'] = private_endpoint_ip - - if nsg_ids is not None: - _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids) - - if auto_refresh_frequency_in_seconds is not None: - _details['autoRefreshFrequencyInSeconds'] = auto_refresh_frequency_in_seconds - - if auto_refresh_point_lag_in_seconds is not None: - _details['autoRefreshPointLagInSeconds'] = auto_refresh_point_lag_in_seconds - - if time_of_auto_refresh_start is not None: - _details['timeOfAutoRefreshStart'] = time_of_auto_refresh_start - - if customer_contacts is not None: - _details['customerContacts'] = cli_util.parse_json_parameter("customer_contacts", customer_contacts) - - if is_mtls_connection_required is not None: - _details['isMtlsConnectionRequired'] = is_mtls_connection_required - - if resource_pool_leader_id is not None: - _details['resourcePoolLeaderId'] = resource_pool_leader_id - - if resource_pool_summary is not None: - _details['resourcePoolSummary'] = cli_util.parse_json_parameter("resource_pool_summary", resource_pool_summary) - - if autonomous_maintenance_schedule_type is not None: - _details['autonomousMaintenanceScheduleType'] = autonomous_maintenance_schedule_type - - if autonomous_database_maintenance_window is not None: - _details['autonomousDatabaseMaintenanceWindow'] = cli_util.parse_json_parameter("autonomous_database_maintenance_window", autonomous_database_maintenance_window) - - if time_maintenance_pause_until is not None: - _details['timeMaintenancePauseUntil'] = time_maintenance_pause_until - - if is_backup_retention_locked is not None: - _details['isBackupRetentionLocked'] = is_backup_retention_locked - - if time_scheduled_db_version_upgrade is not None: - _details['timeScheduledDbVersionUpgrade'] = time_scheduled_db_version_upgrade - - if is_disable_db_version_upgrade_schedule is not None: - _details['isDisableDbVersionUpgradeSchedule'] = is_disable_db_version_upgrade_schedule - - if is_schedule_db_version_upgrade_to_earliest is not None: - _details['isScheduleDbVersionUpgradeToEarliest'] = is_schedule_db_version_upgrade_to_earliest - - if scheduled_operations is not None: - _details['scheduledOperations'] = cli_util.parse_json_parameter("scheduled_operations", scheduled_operations) - - if is_auto_scaling_for_storage_enabled is not None: - _details['isAutoScalingForStorageEnabled'] = is_auto_scaling_for_storage_enabled - - if database_edition is not None: - _details['databaseEdition'] = database_edition - - if db_tools_details is not None: - _details['dbToolsDetails'] = cli_util.parse_json_parameter("db_tools_details", db_tools_details) - - if vanity_url_details is not None: - _details['vanityUrlDetails'] = cli_util.parse_json_parameter("vanity_url_details", vanity_url_details) - - if secret_id is not None: - _details['secretId'] = secret_id - - if secret_version_number is not None: - _details['secretVersionNumber'] = secret_version_number - - if is_disconnect_peer is not None: - _details['isDisconnectPeer'] = is_disconnect_peer - - if local_adg_resource_pool_leader_id is not None: - _details['localAdgResourcePoolLeaderId'] = local_adg_resource_pool_leader_id - - _details['encryptionKey']['provider'] = 'OCI' - - client = cli_util.build_client('database', 'database', ctx) - result = client.update_autonomous_database( - autonomous_database_id=autonomous_database_id, - update_autonomous_database_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_autonomous_database') and callable(getattr(client, 'get_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_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) - - -@autonomous_database_group.command(name=cli_util.override('db.update_autonomous_database_gcp_key_details.command_name', 'update-autonomous-database-gcp-key-details'), help=u"""Updates one or more attributes of the specified Autonomous AI Database. See the UpdateAutonomousDatabaseDetails resource for a full list of attributes that can be updated. \n[Command Reference](updateAutonomousDatabase)""") -@cli_util.option('--autonomous-database-id', required=True, help=u"""The database [OCID].""") -@cli_util.option('--encryption-key-key-name', required=True, help=u"""GCP key name""") -@cli_util.option('--encryption-key-project', required=True, help=u"""GCP project name""") -@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('--backup-retention-period-in-days', type=click.INT, help=u"""Retention period, in days, for long-term backups""") -@cli_util.option('--compute-model', type=custom_types.CliCaseInsensitiveChoice(["ECPU", "OCPU"]), help=u"""The compute model of the Autonomous AI Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ECPU compute model is the recommended model and OCPU compute model is legacy.""") -@cli_util.option('--in-memory-percentage', type=click.INT, help=u"""The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous AI Database. This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform.""") -@cli_util.option('--local-adg-auto-failover-max-data-loss-limit', type=click.INT, help=u"""Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard""") -@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPUs to be made available to the Autonomous AI Database.
For Autonomous AI Databases on Dedicated Exadata Infrastructure: - The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. - It is suggested to use 'computeCount' parameter if you want to use fractional value to provision less than 1 core. - -**Note:** This parameter cannot be used with the `ocpuCount` or `computeCount` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--long-term-backup-schedule', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-dev-tier', type=click.BOOL, help=u"""Autonomous AI Database for Developers are fixed-shape Autonomous AI Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database.""") -@cli_util.option('--compute-count', type=click.FLOAT, help=u"""The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous AI Database Serverless instance or an Autonomous AI Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--ocpu-count', type=click.FLOAT, help=u"""The number of OCPU cores to be made available to the Autonomous AI Database. - -For Autonomous AI Databases on Dedicated Exadata Infrastructure, you can specify a fractional value for this parameter. Fractional values are not supported for Autonomous AI Database Serverless instances. For Autonomous AI Database Serverless instances, this parameter is not used. - -To provision less than 1 core, enter a fractional value in an increment of 0.1. To provision 1 or more cores, you must enter an integer between 1 and the maximum number of cores available to the infrastructure shape. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. Likewise, you can provision 2 cores or 3 cores, but not 2.5 cores. The maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") -@cli_util.option('--data-storage-size-in-tbs', type=click.INT, help=u"""The size, in terabytes, of the data volume that will be created and attached to the database. For Autonomous AI Databases on dedicated Exadata infrastructure, the maximum storage value is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. A full Exadata service is allocated when the Autonomous AI Database size is set to the upper limit (384 TB). - -**Note:** This parameter cannot be used with the `dataStorageSizeInGBs` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--data-storage-size-in-gbs', type=click.INT, help=u"""Applies to dedicated Exadata infrastructure only. - -The size, in gigabytes, of the data volume that will be created and attached to the database. The maximum storage value depends on the system shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `dataStorageSizeInTBs` parameter.""") -@cli_util.option('--display-name', help=u"""The user-friendly name for the Autonomous AI Database. The name does not have to be unique. The display name can only be updated for Autonomous AI Databases using dedicated Exadata Infrastructure. This parameter may not be updated in parallel with dbVersion.""") -@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). - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, or isFreeTier.""") -@cli_util.option('--db-name', help=u"""New name for this Autonomous AI Database. For Autonomous AI Databases on Dedicated Exadata Infrastructure, the name must begin with an alphabetic character, and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. For Autonomous AI Database Serverless instances, the name must begin with an alphabetic character, and can contain a maximum of 30 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails.""") -@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].""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Security Attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Oracle-ZPR\": {\"MaxEgressCount\": {\"value\": \"42\", \"mode\": \"audit\"}}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--db-workload', type=custom_types.CliCaseInsensitiveChoice(["OLTP", "DW", "AJD", "APEX", "LH"]), help=u"""The Autonomous AI Database workload type. The following values are valid: - OLTP - indicates an Autonomous AI Transaction Processing database - DW - indicates an Autonomous AI Lakehouse database - AJD - indicates an Autonomous AI JSON Database - APEX - indicates an Autonomous AI Database with the Oracle APEX AI Application Development workload type. - LH - indicates an Oracle Autonomous AI Lakehouse database - -**Note** Starting December 2026, DW will not be supported as a valid value for this parameter. When creating an Autonomous AI Database, if this parameter is not specified, the default value is `OLTP`. - - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--license-model', type=custom_types.CliCaseInsensitiveChoice(["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"]), help=u"""The Oracle license model that applies to the Oracle Autonomous AI Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle AI Database software licenses and the Oracle AI Database service. Note that when provisioning an [Autonomous AI Database on dedicated Exadata infrastructure], this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous AI Database Serverless] database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--byol-compute-count-limit', type=click.FLOAT, help=u"""The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed.""") -@cli_util.option('--is-access-control-enabled', type=click.BOOL, help=u"""Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - -This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform. For Autonomous AI Database Serverless instances, `whitelistedIps` is used.""") -@cli_util.option('--whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--are-primary-whitelisted-ips-used', type=click.BOOL, help=u"""This field will be null if the Autonomous AI Database is not Data Guard enabled or Access Control is disabled. `TRUE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses the primary's IP access control list (ACL) for standby. `FALSE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses a different IP access control list (ACL) for standby compared to primary.""") -@cli_util.option('--standby-whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates whether auto scaling is enabled for the Autonomous AI Database CPU core count. Setting to `TRUE` enables auto scaling. Setting to `FALSE` disables auto scaling. The default value is `TRUE`. Auto scaling is only available for [Autonomous AI Database Serverless instances].""") -@cli_util.option('--is-refreshable-clone', type=click.BOOL, help=u"""Indicates if the Autonomous AI Database is a refreshable clone. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--refreshable-mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "MANUAL"]), help=u"""The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous AI Database.""") -@cli_util.option('--is-local-data-guard-enabled', type=click.BOOL, help=u"""Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -This cannot be updated in parallel with any of the following: isMTLSRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--is-data-guard-enabled', type=click.BOOL, help=u"""** Deprecated. ** Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -To delete a cross-region standby database, provide the `peerDbId` for the standby database in a remote region, and set `isDataGuardEnabled` to `FALSE`.""") -@cli_util.option('--peer-db-id', help=u"""The database OCID(/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. - -To create or delete a local (in-region) standby, see the `isDataGuardEnabled` parameter. - -When disconnecting a cross-region standby, specify the standby database OCID in this parameter together with `isDisconnectPeer=true`.""") -@cli_util.option('--db-version', help=u"""A valid Oracle AI Database version for Autonomous AI Database. When you specify 23ai for dbversion, the system will provision a 23ai database, but the UI will display it as 26ai. When you specify 26ai for dbversion, the system will provision and display a 26ai database as expected. For new databases, it is recommended to use either 19c or 26ai. - -**Note** Starting December 2026, 23ai will not be supported as a valid value for this parameter.""") -@cli_util.option('--open-mode', type=custom_types.CliCaseInsensitiveChoice(["READ_ONLY", "READ_WRITE"]), help=u"""Indicates the Autonomous AI Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--permission-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "UNRESTRICTED"]), help=u"""The Autonomous AI Database permission level. Restricted mode allows access only by admin users. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet the resource is associated with. - -**Subnet Restrictions:** - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. - For Autonomous AI Database, setting this will disable public secure access to the database. - -These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet.""") -@cli_util.option('--private-endpoint-label', help=u"""The resource's private endpoint label. - Setting the endpoint label to a non-empty string creates a private endpoint database. - Resetting the endpoint label to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. - Setting the endpoint label to a non-empty string value, updates to a new private endpoint database, when the database is disabled and re-enabled. - -This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--private-endpoint-ip', help=u"""The private endpoint Ip address for the resource.""") -@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of [OCIDs] for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules]. **NsgIds restrictions:** - A network security group (NSG) is optional for Autonomous AI Databases with private access. The nsgIds list can be empty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--auto-refresh-frequency-in-seconds', type=click.INT, help=u"""The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter.""") -@cli_util.option('--auto-refresh-point-lag-in-seconds', type=click.INT, help=u"""The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens.""") -@cli_util.option('--time-of-auto-refresh-start', type=custom_types.CLI_DATETIME, help=u"""The the date and time that auto-refreshing will begin for an Autonomous AI Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--customer-contacts', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Customer Contacts. Setting this to an empty list removes all customer contacts of an Oracle - -This cannot be updated in parallel with any of the following: isMTLSConnectionRequired, scheduledOperations, or dbToolsDetails. - -This option is a JSON list with items of type CustomerContact. For documentation on CustomerContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/CustomerContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-mtls-connection-required', type=click.BOOL, help=u"""Specifies if the Autonomous AI Database requires mTLS connections. - -This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: - CreateAutonomousDatabase - GetAutonomousDatabase - UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous AI Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true.""") -@cli_util.option('--resource-pool-leader-id', help=u"""The unique identifier for leader Autonomous AI Database OCID [OCID].""") -@cli_util.option('--resource-pool-summary', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--autonomous-maintenance-schedule-type', type=custom_types.CliCaseInsensitiveChoice(["EARLY", "REGULAR"]), help=u"""The maintenance schedule type of the Autonomous AI Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle""") -@cli_util.option('--autonomous-database-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--time-maintenance-pause-until', type=custom_types.CLI_DATETIME, help=u"""The date until which Autonomous AI Database maintenance is temporarily paused.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-backup-retention-locked', type=click.BOOL, help=u"""True if the Autonomous AI Database is backup retention locked.""") -@cli_util.option('--time-scheduled-db-version-upgrade', type=custom_types.CLI_DATETIME, help=u"""The date and time the Autonomous AI Database scheduled to upgrade to 26ai.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-disable-db-version-upgrade-schedule', type=click.BOOL, help=u"""True if user wants to disable Autonomous AI Database scheduled upgrade to 26ai.""") -@cli_util.option('--is-schedule-db-version-upgrade-to-earliest', type=click.BOOL, help=u"""True if user wants to schedule Autonomous AI Database upgrade to the earliest available time.""") -@cli_util.option('--scheduled-operations', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type ScheduledOperationDetails. For documentation on ScheduledOperationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ScheduledOperationDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-for-storage-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Autonomous AI Database storage. The default value is `FALSE`.""") -@cli_util.option('--database-edition', help=u"""The Oracle AI Database Edition that applies to the Autonomous AI Databases. This parameter accepts options `STANDARD_EDITION` and `ENTERPRISE_EDITION`. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--db-tools-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database tools details. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type DatabaseTool. For documentation on DatabaseTool please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/DatabaseTool.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--vanity-url-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--secret-id', help=u"""The OCI vault secret [/Content/General/Concepts/identifiers.htm]OCID. This cannot be used in conjunction with adminPassword.""") -@cli_util.option('--secret-version-number', type=click.INT, help=u"""The version of the vault secret. If no version is specified, the latest version will be used.""") -@cli_util.option('--is-disconnect-peer', type=click.BOOL, help=u"""If true, this disconnects the Autonomous AI Database from its peer. After the disconnect completes, the Autonomous AI Database works permanently as a standalone database. - -**Warning:** A disconnected standby is no longer part of the disaster recovery configuration. Operations and restrictions that apply to a connected standby do not apply in the same way after the database has been disconnected. - -To disconnect a cross region standby, also provide the OCID of the standby database in the `peerDbId` parameter.""") -@cli_util.option('--local-adg-resource-pool-leader-id', help=u"""The [OCID] of a dedicated resource pool leader Autonomous AI Database in the same region, that is required when local Autonomous Data Guard is enabled for a dedicated resource pool member using the parameter `isLocalDataGuardEnabled`. This field applies only to dedicated resource pool members, and the specified leader must be different from the primary\u2019s leader. Local Autonomous Data Guard can be enabled only if more than one dedicated resource pool exists in the region.""") -@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('--opc-dry-run', type=click.BOOL, help=u"""Indicates that the request is a dry run, if set to \"true\". A dry run request does not actually creating or updating a resource and is used only to perform validation on the submitted data.""") -@cli_util.option('--encryption-key-kms-rest-endpoint', help=u"""GCP kms REST API endpoint""") -@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) -@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING", "RECREATING", "ROLE_CHANGE_IN_PROGRESS", "UPGRADING", "INACCESSIBLE", "STANDBY", "TRANSPORTING"]), 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 PROVISIONING --wait-for-state TRANSPORTING 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({'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'}}) -@cli_util.help_option -@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, 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') - if not force: - if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details: - if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details 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 - if opc_dry_run is not None: - kwargs['opc_dry_run'] = opc_dry_run - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['encryptionKey'] = {} - _details['encryptionKey']['keyName'] = encryption_key_key_name - _details['encryptionKey']['project'] = encryption_key_project - _details['encryptionKey']['location'] = encryption_key_location - _details['encryptionKey']['keyRing'] = encryption_key_key_ring - - if backup_retention_period_in_days is not None: - _details['backupRetentionPeriodInDays'] = backup_retention_period_in_days - - if compute_model is not None: - _details['computeModel'] = compute_model - - if in_memory_percentage is not None: - _details['inMemoryPercentage'] = in_memory_percentage - - if local_adg_auto_failover_max_data_loss_limit is not None: - _details['localAdgAutoFailoverMaxDataLossLimit'] = local_adg_auto_failover_max_data_loss_limit - - if cpu_core_count is not None: - _details['cpuCoreCount'] = cpu_core_count - - if long_term_backup_schedule is not None: - _details['longTermBackupSchedule'] = cli_util.parse_json_parameter("long_term_backup_schedule", long_term_backup_schedule) - - if is_dev_tier is not None: - _details['isDevTier'] = is_dev_tier - - if compute_count is not None: - _details['computeCount'] = compute_count - - if ocpu_count is not None: - _details['ocpuCount'] = ocpu_count - - if data_storage_size_in_tbs is not None: - _details['dataStorageSizeInTBs'] = data_storage_size_in_tbs - - if data_storage_size_in_gbs is not None: - _details['dataStorageSizeInGBs'] = data_storage_size_in_gbs - - if display_name is not None: - _details['displayName'] = display_name - - 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 - - if db_name is not None: - _details['dbName'] = db_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) - - if security_attributes is not None: - _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) - - if db_workload is not None: - _details['dbWorkload'] = db_workload - - if license_model is not None: - _details['licenseModel'] = license_model - - if byol_compute_count_limit is not None: - _details['byolComputeCountLimit'] = byol_compute_count_limit - - if is_access_control_enabled is not None: - _details['isAccessControlEnabled'] = is_access_control_enabled - - if whitelisted_ips is not None: - _details['whitelistedIps'] = cli_util.parse_json_parameter("whitelisted_ips", whitelisted_ips) - - if are_primary_whitelisted_ips_used is not None: - _details['arePrimaryWhitelistedIpsUsed'] = are_primary_whitelisted_ips_used - - if standby_whitelisted_ips is not None: - _details['standbyWhitelistedIps'] = cli_util.parse_json_parameter("standby_whitelisted_ips", standby_whitelisted_ips) - - if is_auto_scaling_enabled is not None: - _details['isAutoScalingEnabled'] = is_auto_scaling_enabled - - if is_refreshable_clone is not None: - _details['isRefreshableClone'] = is_refreshable_clone - - if refreshable_mode is not None: - _details['refreshableMode'] = refreshable_mode - - if is_local_data_guard_enabled is not None: - _details['isLocalDataGuardEnabled'] = is_local_data_guard_enabled - - if is_data_guard_enabled is not None: - _details['isDataGuardEnabled'] = is_data_guard_enabled - - if peer_db_id is not None: - _details['peerDbId'] = peer_db_id - - if db_version is not None: - _details['dbVersion'] = db_version - - if open_mode is not None: - _details['openMode'] = open_mode - - if permission_level is not None: - _details['permissionLevel'] = permission_level - - if subnet_id is not None: - _details['subnetId'] = subnet_id - - if private_endpoint_label is not None: - _details['privateEndpointLabel'] = private_endpoint_label - - if private_endpoint_ip is not None: - _details['privateEndpointIp'] = private_endpoint_ip - - if nsg_ids is not None: - _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids) - - if auto_refresh_frequency_in_seconds is not None: - _details['autoRefreshFrequencyInSeconds'] = auto_refresh_frequency_in_seconds - - if auto_refresh_point_lag_in_seconds is not None: - _details['autoRefreshPointLagInSeconds'] = auto_refresh_point_lag_in_seconds - - if time_of_auto_refresh_start is not None: - _details['timeOfAutoRefreshStart'] = time_of_auto_refresh_start - - if customer_contacts is not None: - _details['customerContacts'] = cli_util.parse_json_parameter("customer_contacts", customer_contacts) - - if is_mtls_connection_required is not None: - _details['isMtlsConnectionRequired'] = is_mtls_connection_required - - if resource_pool_leader_id is not None: - _details['resourcePoolLeaderId'] = resource_pool_leader_id - - if resource_pool_summary is not None: - _details['resourcePoolSummary'] = cli_util.parse_json_parameter("resource_pool_summary", resource_pool_summary) - - if autonomous_maintenance_schedule_type is not None: - _details['autonomousMaintenanceScheduleType'] = autonomous_maintenance_schedule_type - - if autonomous_database_maintenance_window is not None: - _details['autonomousDatabaseMaintenanceWindow'] = cli_util.parse_json_parameter("autonomous_database_maintenance_window", autonomous_database_maintenance_window) - - if time_maintenance_pause_until is not None: - _details['timeMaintenancePauseUntil'] = time_maintenance_pause_until - - if is_backup_retention_locked is not None: - _details['isBackupRetentionLocked'] = is_backup_retention_locked - - if time_scheduled_db_version_upgrade is not None: - _details['timeScheduledDbVersionUpgrade'] = time_scheduled_db_version_upgrade - - if is_disable_db_version_upgrade_schedule is not None: - _details['isDisableDbVersionUpgradeSchedule'] = is_disable_db_version_upgrade_schedule - - if is_schedule_db_version_upgrade_to_earliest is not None: - _details['isScheduleDbVersionUpgradeToEarliest'] = is_schedule_db_version_upgrade_to_earliest - - if scheduled_operations is not None: - _details['scheduledOperations'] = cli_util.parse_json_parameter("scheduled_operations", scheduled_operations) - - if is_auto_scaling_for_storage_enabled is not None: - _details['isAutoScalingForStorageEnabled'] = is_auto_scaling_for_storage_enabled - - if database_edition is not None: - _details['databaseEdition'] = database_edition - - if db_tools_details is not None: - _details['dbToolsDetails'] = cli_util.parse_json_parameter("db_tools_details", db_tools_details) - - if vanity_url_details is not None: - _details['vanityUrlDetails'] = cli_util.parse_json_parameter("vanity_url_details", vanity_url_details) - - if secret_id is not None: - _details['secretId'] = secret_id - - if secret_version_number is not None: - _details['secretVersionNumber'] = secret_version_number - - if is_disconnect_peer is not None: - _details['isDisconnectPeer'] = is_disconnect_peer - - if local_adg_resource_pool_leader_id is not None: - _details['localAdgResourcePoolLeaderId'] = local_adg_resource_pool_leader_id - - if encryption_key_kms_rest_endpoint is not None: - _details['encryptionKey']['kmsRestEndpoint'] = encryption_key_kms_rest_endpoint - - _details['encryptionKey']['provider'] = 'GCP' - - client = cli_util.build_client('database', 'database', ctx) - result = client.update_autonomous_database( - autonomous_database_id=autonomous_database_id, - update_autonomous_database_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_autonomous_database') and callable(getattr(client, 'get_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_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) - - -@autonomous_database_group.command(name=cli_util.override('db.update_autonomous_database_oracle_managed_key_details.command_name', 'update-autonomous-database-oracle-managed-key-details'), help=u"""Updates one or more attributes of the specified Autonomous AI Database. See the UpdateAutonomousDatabaseDetails resource for a full list of attributes that can be updated. \n[Command Reference](updateAutonomousDatabase)""") -@cli_util.option('--autonomous-database-id', required=True, help=u"""The database [OCID].""") -@cli_util.option('--backup-retention-period-in-days', type=click.INT, help=u"""Retention period, in days, for long-term backups""") -@cli_util.option('--compute-model', type=custom_types.CliCaseInsensitiveChoice(["ECPU", "OCPU"]), help=u"""The compute model of the Autonomous AI Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ECPU compute model is the recommended model and OCPU compute model is legacy.""") -@cli_util.option('--in-memory-percentage', type=click.INT, help=u"""The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous AI Database. This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform.""") -@cli_util.option('--local-adg-auto-failover-max-data-loss-limit', type=click.INT, help=u"""Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard""") -@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The number of CPUs to be made available to the Autonomous AI Database.
For Autonomous AI Databases on Dedicated Exadata Infrastructure: - The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. - It is suggested to use 'computeCount' parameter if you want to use fractional value to provision less than 1 core. - -**Note:** This parameter cannot be used with the `ocpuCount` or `computeCount` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--long-term-backup-schedule', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-dev-tier', type=click.BOOL, help=u"""Autonomous AI Database for Developers are fixed-shape Autonomous AI Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database.""") -@cli_util.option('--compute-count', type=click.FLOAT, help=u"""The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous AI Database Serverless instance or an Autonomous AI Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--ocpu-count', type=click.FLOAT, help=u"""The number of OCPU cores to be made available to the Autonomous AI Database. - -For Autonomous AI Databases on Dedicated Exadata Infrastructure, you can specify a fractional value for this parameter. Fractional values are not supported for Autonomous AI Database Serverless instances. For Autonomous AI Database Serverless instances, this parameter is not used. - -To provision less than 1 core, enter a fractional value in an increment of 0.1. To provision 1 or more cores, you must enter an integer between 1 and the maximum number of cores available to the infrastructure shape. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. Likewise, you can provision 2 cores or 3 cores, but not 2.5 cores. The maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") -@cli_util.option('--data-storage-size-in-tbs', type=click.INT, help=u"""The size, in terabytes, of the data volume that will be created and attached to the database. For Autonomous AI Databases on dedicated Exadata infrastructure, the maximum storage value is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes] for shape details. A full Exadata service is allocated when the Autonomous AI Database size is set to the upper limit (384 TB). - -**Note:** This parameter cannot be used with the `dataStorageSizeInGBs` parameter. - -This cannot be updated in parallel with any of the following: licenseModel, databaseEdition, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--data-storage-size-in-gbs', type=click.INT, help=u"""Applies to dedicated Exadata infrastructure only. - -The size, in gigabytes, of the data volume that will be created and attached to the database. The maximum storage value depends on the system shape. See [Characteristics of Infrastructure Shapes] for shape details. - -**Note:** This parameter cannot be used with the `dataStorageSizeInTBs` parameter.""") -@cli_util.option('--display-name', help=u"""The user-friendly name for the Autonomous AI Database. The name does not have to be unique. The display name can only be updated for Autonomous AI Databases using dedicated Exadata Infrastructure. This parameter may not be updated in parallel with dbVersion.""") -@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). - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, or isFreeTier.""") -@cli_util.option('--db-name', help=u"""New name for this Autonomous AI Database. For Autonomous AI Databases on Dedicated Exadata Infrastructure, the name must begin with an alphabetic character, and can contain a maximum of eight alphanumeric characters. Special characters are not permitted. For Autonomous AI Database Serverless instances, the name must begin with an alphabetic character, and can contain a maximum of 30 alphanumeric characters. Special characters are not permitted. The database name must be unique in the tenancy. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails.""") -@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].""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Security Attributes for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags]. Example: `{\"Oracle-ZPR\": {\"MaxEgressCount\": {\"value\": \"42\", \"mode\": \"audit\"}}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--db-workload', type=custom_types.CliCaseInsensitiveChoice(["OLTP", "DW", "AJD", "APEX", "LH"]), help=u"""The Autonomous AI Database workload type. The following values are valid: - OLTP - indicates an Autonomous AI Transaction Processing database - DW - indicates an Autonomous AI Lakehouse database - AJD - indicates an Autonomous AI JSON Database - APEX - indicates an Autonomous AI Database with the Oracle APEX AI Application Development workload type. - LH - indicates an Oracle Autonomous AI Lakehouse database - -**Note** Starting December 2026, DW will not be supported as a valid value for this parameter. When creating an Autonomous AI Database, if this parameter is not specified, the default value is `OLTP`. - - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--license-model', type=custom_types.CliCaseInsensitiveChoice(["LICENSE_INCLUDED", "BRING_YOUR_OWN_LICENSE"]), help=u"""The Oracle license model that applies to the Oracle Autonomous AI Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle AI Database software licenses and the Oracle AI Database service. Note that when provisioning an [Autonomous AI Database on dedicated Exadata infrastructure], this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous AI Database Serverless] database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--byol-compute-count-limit', type=click.FLOAT, help=u"""The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed.""") -@cli_util.option('--is-access-control-enabled', type=click.BOOL, help=u"""Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. - -This property is applicable only to Autonomous AI Databases on the Exadata Cloud@Customer platform. For Autonomous AI Database Serverless instances, `whitelistedIps` is used.""") -@cli_util.option('--whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--are-primary-whitelisted-ips-used', type=click.BOOL, help=u"""This field will be null if the Autonomous AI Database is not Data Guard enabled or Access Control is disabled. `TRUE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses the primary's IP access control list (ACL) for standby. `FALSE` if the Autonomous AI Database has Data Guard and Access Control enabled, and the Autonomous AI Database uses a different IP access control list (ACL) for standby compared to primary.""") -@cli_util.option('--standby-whitelisted-ips', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The client IP access control list (ACL). This feature is available for [Autonomous AI Database Serverless] and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous AI Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous AI Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - -For Autonomous AI Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it\u2019s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"ocid1.vcn.oc1.sea.\",\"ocid1.vcn.oc1.sea.;1.1.1.1\",\"ocid1.vcn.oc1.sea.;1.1.0.0/16\"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `[\"1.1.1.1\",\"1.1.1.0/24\",\"1.1.2.25\"]` - -For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates whether auto scaling is enabled for the Autonomous AI Database CPU core count. Setting to `TRUE` enables auto scaling. Setting to `FALSE` disables auto scaling. The default value is `TRUE`. Auto scaling is only available for [Autonomous AI Database Serverless instances].""") -@cli_util.option('--is-refreshable-clone', type=click.BOOL, help=u"""Indicates if the Autonomous AI Database is a refreshable clone. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.""") -@cli_util.option('--refreshable-mode', type=custom_types.CliCaseInsensitiveChoice(["AUTOMATIC", "MANUAL"]), help=u"""The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous AI Database.""") -@cli_util.option('--is-local-data-guard-enabled', type=click.BOOL, help=u"""Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -This cannot be updated in parallel with any of the following: isMTLSRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--is-data-guard-enabled', type=click.BOOL, help=u"""** Deprecated. ** Indicates whether the Autonomous AI Database has a local (in-region) standby database. Not applicable when creating a cross-region Autonomous Data Guard associations, or to Autonomous AI Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. - -To create a local standby, set to `TRUE`. To delete a local standby, set to `FALSE`. For more information on using Autonomous Data Guard on an Autonomous AI Database Serverless instance (local and cross-region) , see [About Standby Databases] - -To enable cross-region Autonomous Data Guard on an Autonomous AI Database Serverless instance, see [Enable Autonomous Data Guard]. - -To delete a cross-region standby database, provide the `peerDbId` for the standby database in a remote region, and set `isDataGuardEnabled` to `FALSE`.""") -@cli_util.option('--peer-db-id', help=u"""The database OCID(/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. - -To create or delete a local (in-region) standby, see the `isDataGuardEnabled` parameter. - -When disconnecting a cross-region standby, specify the standby database OCID in this parameter together with `isDisconnectPeer=true`.""") -@cli_util.option('--db-version', help=u"""A valid Oracle AI Database version for Autonomous AI Database. When you specify 23ai for dbversion, the system will provision a 23ai database, but the UI will display it as 26ai. When you specify 26ai for dbversion, the system will provision and display a 26ai database as expected. For new databases, it is recommended to use either 19c or 26ai. - -**Note** Starting December 2026, 23ai will not be supported as a valid value for this parameter.""") -@cli_util.option('--open-mode', type=custom_types.CliCaseInsensitiveChoice(["READ_ONLY", "READ_WRITE"]), help=u"""Indicates the Autonomous AI Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--permission-level', type=custom_types.CliCaseInsensitiveChoice(["RESTRICTED", "UNRESTRICTED"]), help=u"""The Autonomous AI Database permission level. Restricted mode allows access only by admin users. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet the resource is associated with. - -**Subnet Restrictions:** - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. - For Autonomous AI Database, setting this will disable public secure access to the database. - -These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet.""") -@cli_util.option('--private-endpoint-label', help=u"""The resource's private endpoint label. - Setting the endpoint label to a non-empty string creates a private endpoint database. - Resetting the endpoint label to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. - Setting the endpoint label to a non-empty string value, updates to a new private endpoint database, when the database is disabled and re-enabled. - -This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--private-endpoint-ip', help=u"""The private endpoint Ip address for the resource.""") -@cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of [OCIDs] for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules]. **NsgIds restrictions:** - A network security group (NSG) is optional for Autonomous AI Databases with private access. The nsgIds list can be empty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--auto-refresh-frequency-in-seconds', type=click.INT, help=u"""The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter.""") -@cli_util.option('--auto-refresh-point-lag-in-seconds', type=click.INT, help=u"""The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens.""") -@cli_util.option('--time-of-auto-refresh-start', type=custom_types.CLI_DATETIME, help=u"""The the date and time that auto-refreshing will begin for an Autonomous AI Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--customer-contacts', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Customer Contacts. Setting this to an empty list removes all customer contacts of an Oracle - -This cannot be updated in parallel with any of the following: isMTLSConnectionRequired, scheduledOperations, or dbToolsDetails. - -This option is a JSON list with items of type CustomerContact. For documentation on CustomerContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/CustomerContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-mtls-connection-required', type=click.BOOL, help=u"""Specifies if the Autonomous AI Database requires mTLS connections. - -This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: - CreateAutonomousDatabase - GetAutonomousDatabase - UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous AI Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true.""") -@cli_util.option('--resource-pool-leader-id', help=u"""The unique identifier for leader Autonomous AI Database OCID [OCID].""") -@cli_util.option('--resource-pool-summary', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--autonomous-maintenance-schedule-type', type=custom_types.CliCaseInsensitiveChoice(["EARLY", "REGULAR"]), help=u"""The maintenance schedule type of the Autonomous AI Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle""") -@cli_util.option('--autonomous-database-maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--time-maintenance-pause-until', type=custom_types.CLI_DATETIME, help=u"""The date until which Autonomous AI Database maintenance is temporarily paused.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-backup-retention-locked', type=click.BOOL, help=u"""True if the Autonomous AI Database is backup retention locked.""") -@cli_util.option('--time-scheduled-db-version-upgrade', type=custom_types.CLI_DATETIME, help=u"""The date and time the Autonomous AI Database scheduled to upgrade to 26ai.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE) -@cli_util.option('--is-disable-db-version-upgrade-schedule', type=click.BOOL, help=u"""True if user wants to disable Autonomous AI Database scheduled upgrade to 26ai.""") -@cli_util.option('--is-schedule-db-version-upgrade-to-earliest', type=click.BOOL, help=u"""True if user wants to schedule Autonomous AI Database upgrade to the earliest available time.""") -@cli_util.option('--scheduled-operations', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type ScheduledOperationDetails. For documentation on ScheduledOperationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ScheduledOperationDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-auto-scaling-for-storage-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Autonomous AI Database storage. The default value is `FALSE`.""") -@cli_util.option('--database-edition', help=u"""The Oracle AI Database Edition that applies to the Autonomous AI Databases. This parameter accepts options `STANDARD_EDITION` and `ENTERPRISE_EDITION`. - -This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.""") -@cli_util.option('--db-tools-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database tools details. - -This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. - -This option is a JSON list with items of type DatabaseTool. For documentation on DatabaseTool please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/DatabaseTool.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--vanity-url-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--secret-id', help=u"""The OCI vault secret [/Content/General/Concepts/identifiers.htm]OCID. This cannot be used in conjunction with adminPassword.""") -@cli_util.option('--secret-version-number', type=click.INT, help=u"""The version of the vault secret. If no version is specified, the latest version will be used.""") -@cli_util.option('--is-disconnect-peer', type=click.BOOL, help=u"""If true, this disconnects the Autonomous AI Database from its peer. After the disconnect completes, the Autonomous AI Database works permanently as a standalone database. - -**Warning:** A disconnected standby is no longer part of the disaster recovery configuration. Operations and restrictions that apply to a connected standby do not apply in the same way after the database has been disconnected. - -To disconnect a cross region standby, also provide the OCID of the standby database in the `peerDbId` parameter.""") -@cli_util.option('--local-adg-resource-pool-leader-id', help=u"""The [OCID] of a dedicated resource pool leader Autonomous AI Database in the same region, that is required when local Autonomous Data Guard is enabled for a dedicated resource pool member using the parameter `isLocalDataGuardEnabled`. This field applies only to dedicated resource pool members, and the specified leader must be different from the primary\u2019s leader. Local Autonomous Data Guard can be enabled only if more than one dedicated resource pool exists in the region.""") -@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('--opc-dry-run', type=click.BOOL, help=u"""Indicates that the request is a dry run, if set to \"true\". A dry run request does not actually creating or updating a resource and is used only to perform validation on the submitted data.""") -@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) -@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "STOPPING", "STOPPED", "STARTING", "TERMINATING", "TERMINATED", "UNAVAILABLE", "RESTORE_IN_PROGRESS", "RESTORE_FAILED", "BACKUP_IN_PROGRESS", "SCALE_IN_PROGRESS", "AVAILABLE_NEEDS_ATTENTION", "UPDATING", "MAINTENANCE_IN_PROGRESS", "RESTARTING", "RECREATING", "ROLE_CHANGE_IN_PROGRESS", "UPGRADING", "INACCESSIBLE", "STANDBY", "TRANSPORTING"]), 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 PROVISIONING --wait-for-state TRANSPORTING 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({'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'}}) -@cli_util.help_option -@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, 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') - if not force: - if long_term_backup_schedule or freeform_tags or defined_tags or security_attributes or whitelisted_ips or standby_whitelisted_ips or nsg_ids or customer_contacts or resource_pool_summary or autonomous_database_maintenance_window or scheduled_operations or db_tools_details or vanity_url_details: - if not click.confirm("WARNING: Updates to long-term-backup-schedule and freeform-tags and defined-tags and security-attributes and whitelisted-ips and standby-whitelisted-ips and nsg-ids and customer-contacts and resource-pool-summary and autonomous-database-maintenance-window and scheduled-operations and db-tools-details and vanity-url-details 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 - if opc_dry_run is not None: - kwargs['opc_dry_run'] = opc_dry_run - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['encryptionKey'] = {} - - if backup_retention_period_in_days is not None: - _details['backupRetentionPeriodInDays'] = backup_retention_period_in_days - - if compute_model is not None: - _details['computeModel'] = compute_model - - if in_memory_percentage is not None: - _details['inMemoryPercentage'] = in_memory_percentage - - if local_adg_auto_failover_max_data_loss_limit is not None: - _details['localAdgAutoFailoverMaxDataLossLimit'] = local_adg_auto_failover_max_data_loss_limit - - if cpu_core_count is not None: - _details['cpuCoreCount'] = cpu_core_count - - if long_term_backup_schedule is not None: - _details['longTermBackupSchedule'] = cli_util.parse_json_parameter("long_term_backup_schedule", long_term_backup_schedule) - - if is_dev_tier is not None: - _details['isDevTier'] = is_dev_tier - - if compute_count is not None: - _details['computeCount'] = compute_count - - if ocpu_count is not None: - _details['ocpuCount'] = ocpu_count - - if data_storage_size_in_tbs is not None: - _details['dataStorageSizeInTBs'] = data_storage_size_in_tbs - - if data_storage_size_in_gbs is not None: - _details['dataStorageSizeInGBs'] = data_storage_size_in_gbs - - if display_name is not None: - _details['displayName'] = display_name - - 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 - - if db_name is not None: - _details['dbName'] = db_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) - - if security_attributes is not None: - _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) - - if db_workload is not None: - _details['dbWorkload'] = db_workload - - if license_model is not None: - _details['licenseModel'] = license_model - - if byol_compute_count_limit is not None: - _details['byolComputeCountLimit'] = byol_compute_count_limit - - if is_access_control_enabled is not None: - _details['isAccessControlEnabled'] = is_access_control_enabled - - if whitelisted_ips is not None: - _details['whitelistedIps'] = cli_util.parse_json_parameter("whitelisted_ips", whitelisted_ips) - - if are_primary_whitelisted_ips_used is not None: - _details['arePrimaryWhitelistedIpsUsed'] = are_primary_whitelisted_ips_used - - if standby_whitelisted_ips is not None: - _details['standbyWhitelistedIps'] = cli_util.parse_json_parameter("standby_whitelisted_ips", standby_whitelisted_ips) - - if is_auto_scaling_enabled is not None: - _details['isAutoScalingEnabled'] = is_auto_scaling_enabled - - if is_refreshable_clone is not None: - _details['isRefreshableClone'] = is_refreshable_clone - - if refreshable_mode is not None: - _details['refreshableMode'] = refreshable_mode - - if is_local_data_guard_enabled is not None: - _details['isLocalDataGuardEnabled'] = is_local_data_guard_enabled - - if is_data_guard_enabled is not None: - _details['isDataGuardEnabled'] = is_data_guard_enabled - - if peer_db_id is not None: - _details['peerDbId'] = peer_db_id - - if db_version is not None: - _details['dbVersion'] = db_version - - if open_mode is not None: - _details['openMode'] = open_mode - - if permission_level is not None: - _details['permissionLevel'] = permission_level - - if subnet_id is not None: - _details['subnetId'] = subnet_id - - if private_endpoint_label is not None: - _details['privateEndpointLabel'] = private_endpoint_label - - if private_endpoint_ip is not None: - _details['privateEndpointIp'] = private_endpoint_ip - - if nsg_ids is not None: - _details['nsgIds'] = cli_util.parse_json_parameter("nsg_ids", nsg_ids) - - if auto_refresh_frequency_in_seconds is not None: - _details['autoRefreshFrequencyInSeconds'] = auto_refresh_frequency_in_seconds - - if auto_refresh_point_lag_in_seconds is not None: - _details['autoRefreshPointLagInSeconds'] = auto_refresh_point_lag_in_seconds - - if time_of_auto_refresh_start is not None: - _details['timeOfAutoRefreshStart'] = time_of_auto_refresh_start - - if customer_contacts is not None: - _details['customerContacts'] = cli_util.parse_json_parameter("customer_contacts", customer_contacts) - - if is_mtls_connection_required is not None: - _details['isMtlsConnectionRequired'] = is_mtls_connection_required - - if resource_pool_leader_id is not None: - _details['resourcePoolLeaderId'] = resource_pool_leader_id - - if resource_pool_summary is not None: - _details['resourcePoolSummary'] = cli_util.parse_json_parameter("resource_pool_summary", resource_pool_summary) - - if autonomous_maintenance_schedule_type is not None: - _details['autonomousMaintenanceScheduleType'] = autonomous_maintenance_schedule_type - - if autonomous_database_maintenance_window is not None: - _details['autonomousDatabaseMaintenanceWindow'] = cli_util.parse_json_parameter("autonomous_database_maintenance_window", autonomous_database_maintenance_window) - - if time_maintenance_pause_until is not None: - _details['timeMaintenancePauseUntil'] = time_maintenance_pause_until - - if is_backup_retention_locked is not None: - _details['isBackupRetentionLocked'] = is_backup_retention_locked - - if time_scheduled_db_version_upgrade is not None: - _details['timeScheduledDbVersionUpgrade'] = time_scheduled_db_version_upgrade - - if is_disable_db_version_upgrade_schedule is not None: - _details['isDisableDbVersionUpgradeSchedule'] = is_disable_db_version_upgrade_schedule - - if is_schedule_db_version_upgrade_to_earliest is not None: - _details['isScheduleDbVersionUpgradeToEarliest'] = is_schedule_db_version_upgrade_to_earliest - - if scheduled_operations is not None: - _details['scheduledOperations'] = cli_util.parse_json_parameter("scheduled_operations", scheduled_operations) - - if is_auto_scaling_for_storage_enabled is not None: - _details['isAutoScalingForStorageEnabled'] = is_auto_scaling_for_storage_enabled - - if database_edition is not None: - _details['databaseEdition'] = database_edition - - if db_tools_details is not None: - _details['dbToolsDetails'] = cli_util.parse_json_parameter("db_tools_details", db_tools_details) - - if vanity_url_details is not None: - _details['vanityUrlDetails'] = cli_util.parse_json_parameter("vanity_url_details", vanity_url_details) - - if secret_id is not None: - _details['secretId'] = secret_id - - if secret_version_number is not None: - _details['secretVersionNumber'] = secret_version_number - - if is_disconnect_peer is not None: - _details['isDisconnectPeer'] = is_disconnect_peer - - if local_adg_resource_pool_leader_id is not None: - _details['localAdgResourcePoolLeaderId'] = local_adg_resource_pool_leader_id - - _details['encryptionKey']['provider'] = 'ORACLE_MANAGED' - - client = cli_util.build_client('database', 'database', ctx) - result = client.update_autonomous_database( - autonomous_database_id=autonomous_database_id, - update_autonomous_database_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_autonomous_database') and callable(getattr(client, 'get_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_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) - - @autonomous_database_backup_group.command(name=cli_util.override('db.update_autonomous_database_backup.command_name', 'update'), help=u"""Updates the Autonomous AI Database backup of the specified database based on the request parameters. \n[Command Reference](updateAutonomousDatabaseBackup)""") @cli_util.option('--autonomous-database-backup-id', required=True, help=u"""The [OCID] of the Autonomous AI Database backup.""") @cli_util.option('--retention-period-in-days', type=click.INT, help=u"""Retention period, in days, for long-term backups""") diff --git a/services/database/tests/util/generated/command_to_api.py b/services/database/tests/util/generated/command_to_api.py index 5fac4c147..2f1165b9f 100644 --- a/services/database/tests/util/generated/command_to_api.py +++ b/services/database/tests/util/generated/command_to_api.py @@ -284,6 +284,7 @@ "db.list_autonomous_virtual_machines": "oci.database.DatabaseClient.list_autonomous_virtual_machines", "db.list_autonomous_vm_cluster_acd_resource_usage": "oci.database.DatabaseClient.list_autonomous_vm_cluster_acd_resource_usage", "db.list_autonomous_vm_clusters": "oci.database.DatabaseClient.list_autonomous_vm_clusters", + "db.list_available_maintenance_windows": "oci.database.DatabaseClient.list_available_maintenance_windows", "db.list_backup_destination": "oci.database.DatabaseClient.list_backup_destination", "db.list_backups": "oci.database.DatabaseClient.list_backups", "db.list_basecc_vm_cluster_update_history_entries": "oci.database.DatabaseClient.list_basecc_vm_cluster_update_history_entries", diff --git a/services/functions/examples_and_test_scripts/example_functions.sh b/services/functions/examples_and_test_scripts/example_functions.sh index 4413c53d9..4a4667641 100755 --- a/services/functions/examples_and_test_scripts/example_functions.sh +++ b/services/functions/examples_and_test_scripts/example_functions.sh @@ -1,289 +1,289 @@ -#!/bin/bash -# Copyright (c) 2016, 2021, 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. -# This script provides an example of how to get bucket in object storage. -# -# Requirements for running this script: -# - OCI CLI v2.4.33 or later (you can check this by running oci --version) -# - jq (https://stedolan.github.io/jq/) for JSON querying and manipulation of CLI output. This may be a useful utility in general -# and may help cater to scenarios which can't be wholly addressed by the --query option in the CLI -# -# Required Environment variables (these should all be within a single region, where applicable): -# OCI_COMPARTMENT_ID - the compartment in which resources will be created -# OCI_FN_IMAGE - The URI of a publicly available image in the Oracle Cloud Infrastructure Registry (OCIR) e.g. phx.ocir.io///: -# OCI_AVAILABILITY_DOMAIN - the AD that your networking will be in (in this example a single AD is used but multiple ADs can be specified to increase redundancy) - -set -e - -PREFIX="OCI_CLI_Example_" - -function run() { - startup - echo "=== CREATING NETWORK LAYER ===" - local subnetID=$(createNetworkLayer) - echo "subnet id: $subnetID" - echo "=== CREATING FUNCTIONS RESOURCES ===" - local appID=$(createApplication ${subnetID}) - echo "app id: $appID" - listApplication - getApplication ${appID} - updateApplication ${appID} - - local fnID=$(createFunction ${appID}) - echo "fn id: $fnID" - listFunction ${appID} - getFunction ${fnID} - updateFunction ${fnID} - - invokeFunction ${fnID} - echo "=== DELETING FUNCTIONS RESOURCES ===" - deleteFunction ${fnID} - deleteApplication ${appID} -} - -function startup() { - - if [[ ${OCI_COMPARTMENT_ID} == "" ]]; then - echo "environment variable OCI_COMPARTMENT_ID must be set" - exit 1 - fi - - if [[ ${OCI_FN_IMAGE} == "" ]]; then - echo "environment variable OCI_FN_IMAGE must be set" - exit 1 - fi - - if [[ ${OCI_AVAILABILITY_DOMAIN} == "" ]]; then - echo "environment variable OCI_AVAILABILITY_DOMAIN must be set" - exit 1 - fi - -} - -function createFunction() { - local appID=$1 - - local fnResp=$(oci fn function create \ - --application-id ${appID} \ - --image ${OCI_FN_IMAGE} \ - --display-name ${PREFIX}Function \ - --memory-in-mbs 128 \ - --wait-for-state ACTIVE \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - - local fnID=$(jq -r '.data.id' <<< ${fnResp}) - local fnEndpoint=$(jq -r '.data."invoke-endpoint"' <<< ${fnResp}) - - echo ${fnID} -} - -function listFunction() { - local appID=$1 - - local fnResp=$(oci fn function list \ - --application-id ${appID} \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - - local fnappID=$(jq -r '.data[]."application-id"' <<< ${fnResp}) - if [[ ${fnappID} != ${appID} ]]; then - echo "Function list failed" - echo "${fnappID} didnot match ${appID}" - exit 1 - fi - - echo "list function successful" -} - -function getFunction() { - local fnID=$1 - - local fnResp=$(oci fn function get \ - --function-id ${fnID} \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - - local getfnID=$(jq -r '.data.id' <<< ${fnResp}) - if [[ ${getfnID} != ${fnID} ]]; then - echo "get function failed: " - echo "${getfnID} didnot match ${fnID}" - exit 1 - fi - - echo "get function successful" -} - -function updateFunction() { - local fnID=$1 - - local fnResp=$(oci fn function update \ - --function-id ${fnID} \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - - local updatefnID=$(jq -r '.data.id' <<< ${fnResp}) - - if [[ ${updatefnID} != ${fnID} ]]; then - echo "Update function failed: " - echo "${updatefnID} didnot match ${fnID}" - exit 1 - fi - - echo "update function successful" -} - -function deleteFunction() { - local fnID=$1 - oci fn function delete --function-id ${fnID} --force - echo "function ${fnID} deleted" -} - -function createApplication() { - local subnetID=$1 - - local appResp=$(oci fn application create \ - --compartment-id ${OCI_COMPARTMENT_ID} \ - --subnet-ids '["'${subnetID}'"]' \ - --display-name ${PREFIX}App \ - --wait-for-state ACTIVE \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - local appID=$(jq -r '.data.id' <<< ${appResp}) - echo ${appID} -} - -function listApplication() { - local appResp=$(oci fn application list \ - --compartment-id ${OCI_COMPARTMENT_ID} \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - local listCompID=$(jq -r '.data[]."compartment-id"' <<< ${appResp}) - listCompID=( `for i in ${listCompID[@]}; do echo $i; done | sort -u` ) - - if [[ ${listCompID[0]} != ${OCI_COMPARTMENT_ID} ]]; then - echo "list application failed: " - echo "${listCompID[0]} didnot match ${OCI_COMPARTMENT_ID}" - exit 1 - fi - - echo "list application successful" -} - -function getApplication() { - local appID=$1 - local appResp=$(oci fn application get \ - --application-id ${appID} \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - local getappID=$(jq -r '.data."id"' <<< ${appResp}) - - if [[ ${getappID} != ${appID} ]]; then - echo "get application failed: " - echo "${getappID} didnot match ${appID}" - exit 1 - fi - - echo "get application successful" -} - -function updateApplication() { - local appID=$1 - local appResp=$(oci fn application update \ - --application-id ${appID} \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - local updateappID=$(jq -r '.data."id"' <<< ${appResp}) - if [[ ${updateappID} != ${appID} ]]; then - echo "update application failed: " - echo "${updateappID} didnot match ${appID}" - exit 1 - fi - - echo "updated application successful" -} - -function deleteApplication() { - local appID=$1 - oci -d fn application delete --application-id ${appID} --force - echo "app ${appID} deleted" -} - -function invokeFunction() { - local fnID=$1 - local invokeResp=$( oci fn function invoke \ - --function-id ${fnID} \ - --file "/tmp/function.out" \ - --body "" \ - 2>&1 \ - ) - invokeResp=$(cat /tmp/function.out) - echo "invoke: $invokeResp" -} - -function createNetworkLayer(){ - - #Create VCN - local vcnResp=$(oci network vcn create \ - --cidr-block '10.0.0.0/16' \ - --compartment-id ${OCI_COMPARTMENT_ID} \ - --dns-label clivcndns \ - --wait-for-state AVAILABLE \ - --display-name ${PREFIX}VCN \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - local vcnID=$(jq -r '.data.id' <<< ${vcnResp}) - local routeTableID=$(jq -r '.data."default-route-table-id"' <<< ${vcnResp}) - - #Create Internet Gateway - local igResp=$(oci network internet-gateway create \ - --compartment-id ${OCI_COMPARTMENT_ID} \ - --vcn-id ${vcnID} \ - --is-enabled true \ - --wait-for-state AVAILABLE \ - --display-name ${PREFIX}Gateway \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - - local gatewayID=$(jq -r '.data.id' <<< ${igResp}) - - #Update default route table with gateway - local rtResp=$(oci network route-table update \ - --rt-id ${routeTableID} \ - --route-rules '[{ "destination": "0.0.0.0/0", "destinationType": "CIDR_BLOCK", "networkEntityId": "'${gatewayID}'" }]' \ - --force \ - --wait-for-state AVAILABLE \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - - #Create a Subnet - local snResp=$(oci network subnet create \ - --cidr-block "10.0.0.0/24" \ - --compartment-id ${OCI_COMPARTMENT_ID} \ - --vcn-id ${vcnID} \ - --availability-domain ${OCI_AVAILABILITY_DOMAIN} \ - --display-name ${PREFIX}Subnet \ - --dns-label clisubnetdns \ - --wait-for-state AVAILABLE \ - | grep -v "Action completed" \ - 2>/dev/null \ - ) - - local subnetID=$(jq -r '.data.id' <<< ${snResp}) - - echo ${subnetID} -} - -# Run the example -run \ No newline at end of file +##!/bin/bash +## Copyright (c) 2016, 2021, 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. +## This script provides an example of how to get bucket in object storage. +## +## Requirements for running this script: +## - OCI CLI v2.4.33 or later (you can check this by running oci --version) +## - jq (https://stedolan.github.io/jq/) for JSON querying and manipulation of CLI output. This may be a useful utility in general +## and may help cater to scenarios which can't be wholly addressed by the --query option in the CLI +## +## Required Environment variables (these should all be within a single region, where applicable): +## OCI_COMPARTMENT_ID - the compartment in which resources will be created +## OCI_FN_IMAGE - The URI of a publicly available image in the Oracle Cloud Infrastructure Registry (OCIR) e.g. phx.ocir.io///: +## OCI_AVAILABILITY_DOMAIN - the AD that your networking will be in (in this example a single AD is used but multiple ADs can be specified to increase redundancy) +# +#set -e +# +#PREFIX="OCI_CLI_Example_" +# +#function run() { +# startup +# echo "=== CREATING NETWORK LAYER ===" +# local subnetID=$(createNetworkLayer) +# echo "subnet id: $subnetID" +# echo "=== CREATING FUNCTIONS RESOURCES ===" +# local appID=$(createApplication ${subnetID}) +# echo "app id: $appID" +# listApplication +# getApplication ${appID} +# updateApplication ${appID} +# +# local fnID=$(createFunction ${appID}) +# echo "fn id: $fnID" +# listFunction ${appID} +# getFunction ${fnID} +# updateFunction ${fnID} +# +# invokeFunction ${fnID} +# echo "=== DELETING FUNCTIONS RESOURCES ===" +# deleteFunction ${fnID} +# deleteApplication ${appID} +#} +# +#function startup() { +# +# if [[ ${OCI_COMPARTMENT_ID} == "" ]]; then +# echo "environment variable OCI_COMPARTMENT_ID must be set" +# exit 1 +# fi +# +# if [[ ${OCI_FN_IMAGE} == "" ]]; then +# echo "environment variable OCI_FN_IMAGE must be set" +# exit 1 +# fi +# +# if [[ ${OCI_AVAILABILITY_DOMAIN} == "" ]]; then +# echo "environment variable OCI_AVAILABILITY_DOMAIN must be set" +# exit 1 +# fi +# +#} +# +#function createFunction() { +# local appID=$1 +# +# local fnResp=$(oci fn function create \ +# --application-id ${appID} \ +# --image ${OCI_FN_IMAGE} \ +# --display-name ${PREFIX}Function \ +# --memory-in-mbs 128 \ +# --wait-for-state ACTIVE \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# +# local fnID=$(jq -r '.data.id' <<< ${fnResp}) +# local fnEndpoint=$(jq -r '.data."invoke-endpoint"' <<< ${fnResp}) +# +# echo ${fnID} +#} +# +#function listFunction() { +# local appID=$1 +# +# local fnResp=$(oci fn function list \ +# --application-id ${appID} \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# +# local fnappID=$(jq -r '.data[]."application-id"' <<< ${fnResp}) +# if [[ ${fnappID} != ${appID} ]]; then +# echo "Function list failed" +# echo "${fnappID} didnot match ${appID}" +# exit 1 +# fi +# +# echo "list function successful" +#} +# +#function getFunction() { +# local fnID=$1 +# +# local fnResp=$(oci fn function get \ +# --function-id ${fnID} \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# +# local getfnID=$(jq -r '.data.id' <<< ${fnResp}) +# if [[ ${getfnID} != ${fnID} ]]; then +# echo "get function failed: " +# echo "${getfnID} didnot match ${fnID}" +# exit 1 +# fi +# +# echo "get function successful" +#} +# +#function updateFunction() { +# local fnID=$1 +# +# local fnResp=$(oci fn function update \ +# --function-id ${fnID} \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# +# local updatefnID=$(jq -r '.data.id' <<< ${fnResp}) +# +# if [[ ${updatefnID} != ${fnID} ]]; then +# echo "Update function failed: " +# echo "${updatefnID} didnot match ${fnID}" +# exit 1 +# fi +# +# echo "update function successful" +#} +# +#function deleteFunction() { +# local fnID=$1 +# oci fn function delete --function-id ${fnID} --force +# echo "function ${fnID} deleted" +#} +# +#function createApplication() { +# local subnetID=$1 +# +# local appResp=$(oci fn application create \ +# --compartment-id ${OCI_COMPARTMENT_ID} \ +# --subnet-ids '["'${subnetID}'"]' \ +# --display-name ${PREFIX}App \ +# --wait-for-state ACTIVE \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# local appID=$(jq -r '.data.id' <<< ${appResp}) +# echo ${appID} +#} +# +#function listApplication() { +# local appResp=$(oci fn application list \ +# --compartment-id ${OCI_COMPARTMENT_ID} \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# local listCompID=$(jq -r '.data[]."compartment-id"' <<< ${appResp}) +# listCompID=( `for i in ${listCompID[@]}; do echo $i; done | sort -u` ) +# +# if [[ ${listCompID[0]} != ${OCI_COMPARTMENT_ID} ]]; then +# echo "list application failed: " +# echo "${listCompID[0]} didnot match ${OCI_COMPARTMENT_ID}" +# exit 1 +# fi +# +# echo "list application successful" +#} +# +#function getApplication() { +# local appID=$1 +# local appResp=$(oci fn application get \ +# --application-id ${appID} \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# local getappID=$(jq -r '.data."id"' <<< ${appResp}) +# +# if [[ ${getappID} != ${appID} ]]; then +# echo "get application failed: " +# echo "${getappID} didnot match ${appID}" +# exit 1 +# fi +# +# echo "get application successful" +#} +# +#function updateApplication() { +# local appID=$1 +# local appResp=$(oci fn application update \ +# --application-id ${appID} \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# local updateappID=$(jq -r '.data."id"' <<< ${appResp}) +# if [[ ${updateappID} != ${appID} ]]; then +# echo "update application failed: " +# echo "${updateappID} didnot match ${appID}" +# exit 1 +# fi +# +# echo "updated application successful" +#} +# +#function deleteApplication() { +# local appID=$1 +# oci -d fn application delete --application-id ${appID} --force +# echo "app ${appID} deleted" +#} +# +#function invokeFunction() { +# local fnID=$1 +# local invokeResp=$( oci fn function invoke \ +# --function-id ${fnID} \ +# --file "/tmp/function.out" \ +# --body "" \ +# 2>&1 \ +# ) +# invokeResp=$(cat /tmp/function.out) +# echo "invoke: $invokeResp" +#} +# +#function createNetworkLayer(){ +# +# #Create VCN +# local vcnResp=$(oci network vcn create \ +# --cidr-block '10.0.0.0/16' \ +# --compartment-id ${OCI_COMPARTMENT_ID} \ +# --dns-label clivcndns \ +# --wait-for-state AVAILABLE \ +# --display-name ${PREFIX}VCN \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# local vcnID=$(jq -r '.data.id' <<< ${vcnResp}) +# local routeTableID=$(jq -r '.data."default-route-table-id"' <<< ${vcnResp}) +# +# #Create Internet Gateway +# local igResp=$(oci network internet-gateway create \ +# --compartment-id ${OCI_COMPARTMENT_ID} \ +# --vcn-id ${vcnID} \ +# --is-enabled true \ +# --wait-for-state AVAILABLE \ +# --display-name ${PREFIX}Gateway \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# +# local gatewayID=$(jq -r '.data.id' <<< ${igResp}) +# +# #Update default route table with gateway +# local rtResp=$(oci network route-table update \ +# --rt-id ${routeTableID} \ +# --route-rules '[{ "destination": "0.0.0.0/0", "destinationType": "CIDR_BLOCK", "networkEntityId": "'${gatewayID}'" }]' \ +# --force \ +# --wait-for-state AVAILABLE \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# +# #Create a Subnet +# local snResp=$(oci network subnet create \ +# --cidr-block "10.0.0.0/24" \ +# --compartment-id ${OCI_COMPARTMENT_ID} \ +# --vcn-id ${vcnID} \ +# --availability-domain ${OCI_AVAILABILITY_DOMAIN} \ +# --display-name ${PREFIX}Subnet \ +# --dns-label clisubnetdns \ +# --wait-for-state AVAILABLE \ +# | grep -v "Action completed" \ +# 2>/dev/null \ +# ) +# +# local subnetID=$(jq -r '.data.id' <<< ${snResp}) +# +# echo ${subnetID} +#} +# +## Run the example +#run diff --git a/services/generative_ai_data/tests/util/generated/command_to_api.py b/services/generative_ai_data/tests/util/generated/command_to_api.py index 167baf145..60be2da80 100644 --- a/services/generative_ai_data/tests/util/generated/command_to_api.py +++ b/services/generative_ai_data/tests/util/generated/command_to_api.py @@ -1,25 +1,5 @@ # coding: utf-8 -# 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. -# -# If you elect to accept the software under the Apache License, Version 2.0, -# the following applies: -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. SDK_client_map = { "generate_sql.generate_sql_from_nl": "oci.generative_ai_data.GenerateSqlClient.generate_sql_from_nl", diff --git a/services/iot/src/oci_cli_iot/generated/iot_cli.py b/services/iot/src/oci_cli_iot/generated/iot_cli.py index d8ce0e982..9a8c9fe21 100644 --- a/services/iot/src/oci_cli_iot/generated/iot_cli.py +++ b/services/iot/src/oci_cli_iot/generated/iot_cli.py @@ -63,6 +63,12 @@ def digital_twin_adapter_group(): pass +@click.command(cli_util.override('iot.iot_flow_runtime_group.command_name', 'iot-flow-runtime'), cls=CommandGroupWithAlias, help="""An IoT flow runtime is a managed Node-RED runtime in an IoT domain for building and running Node-RED flows.""") +@cli_util.help_option_group +def iot_flow_runtime_group(): + pass + + @click.command(cli_util.override('iot.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""An asynchronous work request helps monitor long-running operations. When you initiate a long-running operation, the service creates a work request. This work request acts as an activity log, allowing you to track each step of the operation\u2019s progress. Each work request has an OCID, enabling programmatic interaction and automation.""") @cli_util.help_option_group def work_request_group(): @@ -82,10 +88,66 @@ def digital_twin_instance_group(): iot_root_group.add_command(digital_twin_model_group) iot_root_group.add_command(iot_domain_group_group) iot_root_group.add_command(digital_twin_adapter_group) +iot_root_group.add_command(iot_flow_runtime_group) iot_root_group.add_command(work_request_group) iot_root_group.add_command(digital_twin_instance_group) +@iot_flow_runtime_group.command(name=cli_util.override('iot.activate_iot_flow_runtime.command_name', 'activate'), help=u"""Activates the IoT flow runtime identified by the specified OCID. \n[Command Reference](activateIotFlowRuntime)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@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"]), 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 SUCCEEDED 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 activate_iot_flow_runtime(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_flow_runtime_id, if_match): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-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('iot', 'iot', ctx) + result = client.activate_iot_flow_runtime( + iot_flow_runtime_id=iot_flow_runtime_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) + + @iot_domain_group.command(name=cli_util.override('iot.change_iot_domain_compartment.command_name', 'change-compartment'), help=u"""Moves an IoT domain to a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeIotDomainCompartment)""") @cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment corresponding to the resource.""") @@ -271,6 +333,67 @@ def change_iot_domain_group_compartment(ctx, from_json, wait_for_state, max_wait cli_util.render_response(result, ctx) +@iot_flow_runtime_group.command(name=cli_util.override('iot.change_iot_flow_runtime_compartment.command_name', 'change-compartment'), help=u"""Moves an IoT flow runtime to a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment]. \n[Command Reference](changeIotFlowRuntimeCompartment)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment corresponding to the resource.""") +@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"]), 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 SUCCEEDED 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_iot_flow_runtime_compartment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_flow_runtime_id, compartment_id, if_match): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-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('iot', 'iot', ctx) + result = client.change_iot_flow_runtime_compartment( + iot_flow_runtime_id=iot_flow_runtime_id, + change_iot_flow_runtime_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) + + @iot_domain_group.command(name=cli_util.override('iot.configure_iot_domain_data_access.command_name', 'configure-iot-domain-data-access'), help=u"""Updates an IoT domain Data Access. \n[Command Reference](configureIotDomainDataAccess)""") @cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""") @cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DIRECT", "ORDS", "APEX"]), help=u"""configuration type""") @@ -671,7 +794,7 @@ def create_digital_twin_adapter(ctx, from_json, wait_for_state, max_wait_seconds @digital_twin_instance_group.command(name=cli_util.override('iot.create_digital_twin_instance.command_name', 'create'), help=u"""Creates a new digital twin instance. \n[Command Reference](createDigitalTwinInstance)""") @cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""") -@cli_util.option('--connectivity-type', type=custom_types.CliCaseInsensitiveChoice(["DIRECT", "INDIRECT", "GATEWAY", "NONE"]), help=u"""Connectivity type of the digital twin instance""") +@cli_util.option('--connectivity-type', type=custom_types.CliCaseInsensitiveChoice(["DIRECT", "INDIRECT", "GATEWAY", "NONE"]), help=u"""Connectivity type of the digital twin instance.""") @cli_util.option('--auth-id', help=u"""The [OCID] of the resource (like VaultSecret, ClientCertificate etc.,) used to authenticate the digital twin instance.""") @cli_util.option('--external-key', help=u"""A unique identifier for the physical entity (typically an IoT device) represented by the digital twin instance. This could be a Bluetooth address, Ethernet MAC address, or serial number, depending on the use case. If not provided, the system will automatically generate one.""") @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.""") @@ -1068,6 +1191,148 @@ def create_iot_domain_group(ctx, from_json, wait_for_state, max_wait_seconds, wa cli_util.render_response(result, ctx) +@iot_flow_runtime_group.command(name=cli_util.override('iot.create_iot_flow_runtime.command_name', 'create'), help=u"""Creates an IoT flow runtime. \n[Command Reference](createIotFlowRuntime)""") +@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment corresponding to the resource.""") +@cli_util.option('--scale', type=custom_types.CliCaseInsensitiveChoice(["LOWEST", "LOW", "MEDIUM", "HIGH", "HIGHEST"]), help=u"""The scale of the IoT flow runtime. Larger values allocate more CPU and memory for higher throughput and operational headroom. MEDIUM is the default value.""") +@cli_util.option('--network-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--log-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@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('--description', help=u"""A short description of the resource.""") +@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"]), 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 SUCCEEDED 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({'network-config': {'module': 'iot', 'class': 'NetworkConfigDetails'}, 'log-config': {'module': 'iot', 'class': 'LogConfigDetails'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', '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={'network-config': {'module': 'iot', 'class': 'NetworkConfigDetails'}, 'log-config': {'module': 'iot', 'class': 'LogConfigDetails'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'IotFlowRuntime'}) +@cli_util.wrap_exceptions +def create_iot_flow_runtime(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_domain_id, compartment_id, scale, network_config, log_config, display_name, description, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['iotDomainId'] = iot_domain_id + _details['compartmentId'] = compartment_id + + if scale is not None: + _details['scale'] = scale + + if network_config is not None: + _details['networkConfig'] = cli_util.parse_json_parameter("network_config", network_config) + + if log_config is not None: + _details['logConfig'] = cli_util.parse_json_parameter("log_config", log_config) + + 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('iot', 'iot', ctx) + result = client.create_iot_flow_runtime( + create_iot_flow_runtime_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) + + +@iot_flow_runtime_group.command(name=cli_util.override('iot.deactivate_iot_flow_runtime.command_name', 'deactivate'), help=u"""Deactivates the IoT flow runtime identified by the specified OCID. \n[Command Reference](deactivateIotFlowRuntime)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@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"]), 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 SUCCEEDED 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 deactivate_iot_flow_runtime(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_flow_runtime_id, if_match): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-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('iot', 'iot', ctx) + result = client.deactivate_iot_flow_runtime( + iot_flow_runtime_id=iot_flow_runtime_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) + + @digital_twin_adapter_group.command(name=cli_util.override('iot.delete_digital_twin_adapter.command_name', 'delete'), help=u"""Deletes the digital twin adapter identified by the specified OCID. \n[Command Reference](deleteDigitalTwinAdapter)""") @cli_util.option('--digital-twin-adapter-id', required=True, help=u"""The [OCID] of the digital twin adapter.""") @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.""") @@ -1436,6 +1701,62 @@ def delete_iot_domain_group(ctx, from_json, wait_for_state, max_wait_seconds, wa cli_util.render_response(result, ctx) +@iot_flow_runtime_group.command(name=cli_util.override('iot.delete_iot_flow_runtime.command_name', 'delete'), help=u"""Deletes the IoT flow runtime identified by the specified OCID. \n[Command Reference](deleteIotFlowRuntime)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@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"]), 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 SUCCEEDED 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_iot_flow_runtime(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_flow_runtime_id, if_match): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-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('iot', 'iot', ctx) + result = client.delete_iot_flow_runtime( + iot_flow_runtime_id=iot_flow_runtime_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) + + @digital_twin_adapter_group.command(name=cli_util.override('iot.get_digital_twin_adapter.command_name', 'get'), help=u"""Retrieves the digital twin adapter identified by the specified OCID. \n[Command Reference](getDigitalTwinAdapter)""") @cli_util.option('--digital-twin-adapter-id', required=True, help=u"""The [OCID] of the digital twin adapter.""") @json_skeleton_utils.get_cli_json_input_option({}) @@ -1615,6 +1936,50 @@ def get_iot_domain_group(ctx, from_json, iot_domain_group_id): cli_util.render_response(result, ctx) +@iot_flow_runtime_group.command(name=cli_util.override('iot.get_iot_flow_runtime.command_name', 'get'), help=u"""Gets the IoT flow runtime identified by the specified OCID. \n[Command Reference](getIotFlowRuntime)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@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': 'iot', 'class': 'IotFlowRuntime'}) +@cli_util.wrap_exceptions +def get_iot_flow_runtime(ctx, from_json, iot_flow_runtime_id): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-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('iot', 'iot', ctx) + result = client.get_iot_flow_runtime( + iot_flow_runtime_id=iot_flow_runtime_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@iot_flow_runtime_group.command(name=cli_util.override('iot.get_iot_flow_runtime_flows.command_name', 'get-iot-flow-runtime-flows'), help=u"""Gets the opaque flows document for the IoT flow runtime identified by the specified OCID. \n[Command Reference](getIotFlowRuntimeFlows)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@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_iot_flow_runtime_flows(ctx, from_json, iot_flow_runtime_id): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-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('iot', 'iot', ctx) + result = client.get_iot_flow_runtime_flows( + iot_flow_runtime_id=iot_flow_runtime_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @work_request_group.command(name=cli_util.override('iot.get_work_request.command_name', 'get'), help=u"""Retrieves the status of the work request with the given ID. \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({}) @@ -1830,7 +2195,7 @@ def invoke_raw_command_invoke_raw_json_command_details(ctx, from_json, digital_t @digital_twin_adapter_group.command(name=cli_util.override('iot.list_digital_twin_adapters.command_name', 'list'), help=u"""Retrieves a list of digital twin adapters within the specified IoT domain. \n[Command Reference](listDigitalTwinAdapters)""") -@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""") +@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list IoT resources.""") @cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""") @cli_util.option('--digital-twin-model-spec-uri', help=u"""Filter resources that match the specified URI (DTMI) of the digital twin model.""") @cli_util.option('--digital-twin-model-id', help=u"""Filter resources that match the specified [OCID] of the digital twin model.""") @@ -1899,7 +2264,7 @@ def list_digital_twin_adapters(ctx, from_json, all_pages, page_size, iot_domain_ @digital_twin_instance_group.command(name=cli_util.override('iot.list_digital_twin_instances.command_name', 'list'), help=u"""Retrieves a list of digital twin instances within the specified IoT domain. \n[Command Reference](listDigitalTwinInstances)""") -@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""") +@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list IoT resources.""") @cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""") @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"""Page representing the requested page of items.""") @@ -1971,7 +2336,7 @@ def list_digital_twin_instances(ctx, from_json, all_pages, page_size, iot_domain @digital_twin_model_group.command(name=cli_util.override('iot.list_digital_twin_models.command_name', 'list'), help=u"""Retrieves a list of digital twin models within the specified IoT domain. \n[Command Reference](listDigitalTwinModels)""") -@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""") +@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list IoT resources.""") @cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""") @cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""") @cli_util.option('--spec-uri-starts-with', help=u"""Filters resources by spec URI prefix. For example, to search all versions of the `dtmi:example:device;1` model, pass the prefix without the version: `dtmi:example:device`.""") @@ -2037,7 +2402,7 @@ def list_digital_twin_models(ctx, from_json, all_pages, page_size, iot_domain_id @digital_twin_relationship_group.command(name=cli_util.override('iot.list_digital_twin_relationships.command_name', 'list'), help=u"""Retrieves a list of digital twin relationships within the specified IoT domain. \n[Command Reference](listDigitalTwinRelationships)""") -@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list digital twin resources.""") +@cli_util.option('--iot-domain-id', required=True, help=u"""The [OCID] of the IoT domain in which to list IoT resources.""") @cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""") @cli_util.option('--content-path', help=u"""Filters resources that match the content path of the digital twin relationship.""") @cli_util.option('--source-digital-twin-instance-id', help=u"""Filter resources that match the specified [OCID] of source digital twin instance.""") @@ -2113,7 +2478,7 @@ def list_digital_twin_relationships(ctx, from_json, all_pages, page_size, iot_do @cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""") @cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""") @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""") -@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["PRODUCTION", "DEVELOPMENT", "STANDARD", "LIGHTWEIGHT"]), help=u"""Filter resources by type. Valid values are LIGHTWEIGHT or STANDARD.""") +@cli_util.option('--type', type=custom_types.CliCaseInsensitiveChoice(["PRODUCTION", "DEVELOPMENT", "STANDARD", "LIGHTWEIGHT"]), help=u"""Filter resources by type. Valid values are DEVELOPMENT or PRODUCTION. LIGHTWEIGHT and STANDARD are deprecated aliases for DEVELOPMENT and PRODUCTION, respectively.""") @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 on how pagination works, see [List Pagination].""") @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""") @@ -2240,6 +2605,72 @@ def list_iot_domains(ctx, from_json, all_pages, page_size, compartment_id, id, i cli_util.render_response(result, ctx) +@iot_flow_runtime_group.command(name=cli_util.override('iot.list_iot_flow_runtimes.command_name', 'list'), help=u"""Lists IoT flow runtimes in the specified compartment. \n[Command Reference](listIotFlowRuntimes)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment in which to list resources.""") +@cli_util.option('--id', help=u"""Filter resources by [OCID]. Must be a valid OCID of the resource type.""") +@cli_util.option('--iot-domain-id', help=u"""The [OCID] of the IoT domain in which to list flow runtime.""") +@cli_util.option('--display-name', help=u"""Filter resources whose display name matches the specified value.""") +@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""Filter resources whose lifecycleState matches the specified value.""") +@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 on how pagination works, see [List Pagination].""") +@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""Specifies sort order to use, either ASC (ascending) or DESC (descending).""") +@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), 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('--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': 'iot', 'class': 'IotFlowRuntimeCollection'}) +@cli_util.wrap_exceptions +def list_iot_flow_runtimes(ctx, from_json, all_pages, page_size, compartment_id, id, iot_domain_id, display_name, lifecycle_state, 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 id is not None: + kwargs['id'] = id + if iot_domain_id is not None: + kwargs['iot_domain_id'] = iot_domain_id + if display_name is not None: + kwargs['display_name'] = display_name + 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 + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + client = cli_util.build_client('iot', 'iot', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_iot_flow_runtimes, + compartment_id=compartment_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_iot_flow_runtimes, + limit, + page_size, + compartment_id=compartment_id, + **kwargs + ) + else: + result = client.list_iot_flow_runtimes( + compartment_id=compartment_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @work_request_group.command(name=cli_util.override('iot.list_work_request_errors.command_name', 'list-work-request-errors'), help=u"""Lists errors associated with the specified 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 on how pagination works, see [List Pagination].""") @@ -2509,6 +2940,7 @@ def update_digital_twin_adapter(ctx, from_json, force, wait_for_state, max_wait_ @digital_twin_instance_group.command(name=cli_util.override('iot.update_digital_twin_instance.command_name', 'update'), help=u"""Updates the details of digital twin instance identified by the specified OCID. \n[Command Reference](updateDigitalTwinInstance)""") @cli_util.option('--digital-twin-instance-id', required=True, help=u"""The [OCID] of digital twin instance.""") +@cli_util.option('--connectivity-type', type=custom_types.CliCaseInsensitiveChoice(["DIRECT", "INDIRECT", "GATEWAY", "NONE"]), help=u"""Connectivity type of the digital twin instance.""") @cli_util.option('--auth-id', help=u"""The [OCID] of the resource (like VaultSecret, ClientCertificate etc.,) used to authenticate the digital twin instance.""") @cli_util.option('--external-key', help=u"""A unique identifier for the physical entity (typically an IoT device) represented by the digital twin instance. This could be a Bluetooth address, Ethernet MAC address, or serial number, depending on the use case. If not provided, the system will automatically generate one.""") @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.""") @@ -2533,7 +2965,7 @@ def update_digital_twin_adapter(ctx, from_json, force, wait_for_state, max_wait_ @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'gateways': {'module': 'iot', 'class': 'list[string]'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'iot', 'class': 'DigitalTwinInstance'}) @cli_util.wrap_exceptions -def update_digital_twin_instance(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_instance_id, auth_id, external_key, display_name, description, digital_twin_adapter_id, digital_twin_model_id, digital_twin_model_spec_uri, gateways, freeform_tags, defined_tags, if_match): +def update_digital_twin_instance(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, digital_twin_instance_id, connectivity_type, auth_id, external_key, display_name, description, digital_twin_adapter_id, digital_twin_model_id, digital_twin_model_spec_uri, gateways, freeform_tags, defined_tags, if_match): if isinstance(digital_twin_instance_id, six.string_types) and len(digital_twin_instance_id.strip()) == 0: raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string') @@ -2549,6 +2981,9 @@ def update_digital_twin_instance(ctx, from_json, force, wait_for_state, max_wait _details = {} + if connectivity_type is not None: + _details['connectivityType'] = connectivity_type + if auth_id is not None: _details['authId'] = auth_id @@ -2941,3 +3376,126 @@ def update_iot_domain_group(ctx, from_json, force, wait_for_state, max_wait_seco else: click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) cli_util.render_response(result, ctx) + + +@iot_flow_runtime_group.command(name=cli_util.override('iot.update_iot_flow_runtime.command_name', 'update'), help=u"""Updates the IoT flow runtime identified by the specified OCID. \n[Command Reference](updateIotFlowRuntime)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@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('--description', help=u"""A short description of the resource.""") +@cli_util.option('--scale', type=custom_types.CliCaseInsensitiveChoice(["LOWEST", "LOW", "MEDIUM", "HIGH", "HIGHEST"]), help=u"""The scale of the IoT flow runtime. Larger values allocate more CPU and memory for higher throughput and operational headroom. MEDIUM is the default value.""") +@cli_util.option('--network-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--log-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@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"]), 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 SUCCEEDED 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({'network-config': {'module': 'iot', 'class': 'NetworkConfigDetails'}, 'log-config': {'module': 'iot', 'class': 'LogConfigDetails'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', '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={'network-config': {'module': 'iot', 'class': 'NetworkConfigDetails'}, 'log-config': {'module': 'iot', 'class': 'LogConfigDetails'}, 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}) +@cli_util.wrap_exceptions +def update_iot_flow_runtime(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, iot_flow_runtime_id, display_name, description, scale, network_config, log_config, freeform_tags, defined_tags, if_match): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-id cannot be whitespace or empty string') + if not force: + if network_config or log_config or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to network-config and log-config 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 description is not None: + _details['description'] = description + + if scale is not None: + _details['scale'] = scale + + if network_config is not None: + _details['networkConfig'] = cli_util.parse_json_parameter("network_config", network_config) + + if log_config is not None: + _details['logConfig'] = cli_util.parse_json_parameter("log_config", log_config) + + 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('iot', 'iot', ctx) + result = client.update_iot_flow_runtime( + iot_flow_runtime_id=iot_flow_runtime_id, + update_iot_flow_runtime_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) + + +@iot_flow_runtime_group.command(name=cli_util.override('iot.update_iot_flow_runtime_flows.command_name', 'update-iot-flow-runtime-flows'), help=u"""Replaces the complete flows document for the IoT flow runtime identified by the specified OCID. \n[Command Reference](updateIotFlowRuntimeFlows)""") +@cli_util.option('--iot-flow-runtime-id', required=True, help=u"""The [OCID] of an IoT flow runtime.""") +@cli_util.option('--flows-document', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""The opaque flows document for the IoT flow runtime.""" + 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({'flows-document': {'module': 'iot', 'class': ''}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'flows-document': {'module': 'iot', 'class': ''}}) +@cli_util.wrap_exceptions +def update_iot_flow_runtime_flows(ctx, from_json, iot_flow_runtime_id, flows_document, if_match): + + if isinstance(iot_flow_runtime_id, six.string_types) and len(iot_flow_runtime_id.strip()) == 0: + raise click.UsageError('Parameter --iot-flow-runtime-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('iot', 'iot', ctx) + result = client.update_iot_flow_runtime_flows( + iot_flow_runtime_id=iot_flow_runtime_id, + flows_document=cli_util.parse_json_parameter("flows_document", flows_document), + **kwargs + ) + cli_util.render_response(result, ctx) diff --git a/services/iot/src/oci_cli_iot/iot_cli_extended.py b/services/iot/src/oci_cli_iot/iot_cli_extended.py index 3b781ab7e..411e29469 100644 --- a/services/iot/src/oci_cli_iot/iot_cli_extended.py +++ b/services/iot/src/oci_cli_iot/iot_cli_extended.py @@ -4,6 +4,9 @@ import click # noqa: F401 import json # noqa: F401 +import oci +import six +import sys from services.iot.src.oci_cli_iot.generated import iot_cli from oci_cli import cli_util # noqa: F401 from oci_cli import custom_types # noqa: F401 @@ -72,3 +75,126 @@ # Remove invoke-raw-command from oci iot digital-twin-instance iot_cli.digital_twin_instance_group.commands.pop(iot_cli.invoke_raw_command.name) + +# oci iot iot-flow-runtime -> oci iot flow-runtime +cli_util.rename_command(iot_cli, iot_cli.iot_root_group, iot_cli.iot_flow_runtime_group, "flow-runtime") + + +# oci iot flow-runtime deploy-iot-flow-runtime-flows -> oci iot flow-runtime update-flows +cli_util.rename_command(iot_cli, iot_cli.iot_flow_runtime_group, iot_cli.update_iot_flow_runtime_flows, "update-flows") + + +# oci iot flow-runtime get-iot-flow-runtime-flows -> oci iot flow-runtime get-flows +cli_util.rename_command(iot_cli, iot_cli.iot_flow_runtime_group, iot_cli.get_iot_flow_runtime_flows, "get-flows") + + +class NullableAuthId(click.types.StringParamType): + + def convert(self, value, param, ctx): + value = super(NullableAuthId, self).convert(value, param, ctx) + if isinstance(value, six.string_types) and value.lower() == 'null': + return None + return value + + +@cli_util.copy_params_from_generated_command( + iot_cli.update_digital_twin_instance, params_to_exclude=['auth_id']) +@iot_cli.digital_twin_instance_group.command( + name=iot_cli.update_digital_twin_instance.name, + help=iot_cli.update_digital_twin_instance.help) +@cli_util.option( + '--auth-id', + type=NullableAuthId(), + help='The OCID of the authentication resource. Specify null to clear the value.') +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler( + input_params_to_complex_types={ + 'gateways': {'module': 'iot', 'class': 'list[string]'}, + 'freeform-tags': {'module': 'iot', 'class': 'dict(str, string)'}, + 'defined-tags': {'module': 'iot', 'class': 'dict(str, dict(str, object))'}}, + output_type={'module': 'iot', 'class': 'DigitalTwinInstance'}) +@cli_util.wrap_exceptions +def update_digital_twin_instance_extended(ctx, **kwargs): + digital_twin_instance_id = kwargs['digital_twin_instance_id'] + if isinstance(digital_twin_instance_id, six.string_types) and not digital_twin_instance_id.strip(): + raise click.UsageError('Parameter --digital-twin-instance-id cannot be whitespace or empty string') + + if not kwargs['force'] and any( + kwargs[name] for name in ('gateways', 'freeform_tags', 'defined_tags')): + if not click.confirm( + 'WARNING: Updates to gateways and freeform-tags and defined-tags will replace any ' + 'existing values. Are you sure you want to continue?'): + ctx.abort() + + request_kwargs = {'opc_request_id': cli_util.use_or_generate_request_id(ctx.obj['request_id'])} + if kwargs['if_match'] is not None: + request_kwargs['if_match'] = kwargs['if_match'] + + details = {} + scalar_fields = { + 'connectivity_type': 'connectivityType', + 'external_key': 'externalKey', + 'display_name': 'displayName', + 'description': 'description', + 'digital_twin_adapter_id': 'digitalTwinAdapterId', + 'digital_twin_model_id': 'digitalTwinModelId', + 'digital_twin_model_spec_uri': 'digitalTwinModelSpecUri'} + for parameter_name, payload_name in scalar_fields.items(): + if kwargs[parameter_name] is not None: + details[payload_name] = kwargs[parameter_name] + + # Preserve an explicitly supplied null (from --auth-id null or --from-json) while leaving an + # omitted authId unchanged. This enables an atomic DIRECT -> INDIRECT transition. + if ctx.get_parameter_source('auth_id') is not click.core.ParameterSource.DEFAULT: + details['authId'] = kwargs['auth_id'] + + for parameter_name, payload_name in ( + ('gateways', 'gateways'), + ('freeform_tags', 'freeformTags'), + ('defined_tags', 'definedTags')): + if kwargs[parameter_name] is not None: + details[payload_name] = cli_util.parse_json_parameter(parameter_name, kwargs[parameter_name]) + + client = cli_util.build_client('iot', 'iot', ctx) + result = client.update_digital_twin_instance( + digital_twin_instance_id=digital_twin_instance_id, + update_digital_twin_instance_details=details, + **request_kwargs) + + if kwargs['wait_for_state']: + if hasattr(client, 'get_digital_twin_instance') and callable( + getattr(client, 'get_digital_twin_instance')): + try: + wait_period_kwargs = {} + if kwargs['max_wait_seconds'] is not None: + wait_period_kwargs['max_wait_seconds'] = kwargs['max_wait_seconds'] + if kwargs['wait_interval_seconds'] is not None: + wait_period_kwargs['max_interval_seconds'] = kwargs['wait_interval_seconds'] + click.echo( + 'Action completed. Waiting until the resource has entered state: {}'.format( + kwargs['wait_for_state']), + file=sys.stderr) + result = oci.wait_until( + client, + client.get_digital_twin_instance(result.data.id), + 'lifecycle_state', + kwargs['wait_for_state'], + **wait_period_kwargs) + except oci.exceptions.MaximumWaitTimeExceeded: + 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/iot/tests/util/generated/command_to_api.py b/services/iot/tests/util/generated/command_to_api.py index 36a9171e6..34b9556ef 100644 --- a/services/iot/tests/util/generated/command_to_api.py +++ b/services/iot/tests/util/generated/command_to_api.py @@ -2,9 +2,11 @@ # Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved. SDK_client_map = { + "iot.activate_iot_flow_runtime": "oci.iot.IotClient.activate_iot_flow_runtime", "iot.change_iot_domain_compartment": "oci.iot.IotClient.change_iot_domain_compartment", "iot.change_iot_domain_data_retention_period": "oci.iot.IotClient.change_iot_domain_data_retention_period", "iot.change_iot_domain_group_compartment": "oci.iot.IotClient.change_iot_domain_group_compartment", + "iot.change_iot_flow_runtime_compartment": "oci.iot.IotClient.change_iot_flow_runtime_compartment", "iot.configure_iot_domain_data_access": "oci.iot.IotClient.configure_iot_domain_data_access", "iot.configure_iot_domain_group_data_access": "oci.iot.IotClient.configure_iot_domain_group_data_access", "iot.create_digital_twin_adapter": "oci.iot.IotClient.create_digital_twin_adapter", @@ -13,12 +15,15 @@ "iot.create_digital_twin_relationship": "oci.iot.IotClient.create_digital_twin_relationship", "iot.create_iot_domain": "oci.iot.IotClient.create_iot_domain", "iot.create_iot_domain_group": "oci.iot.IotClient.create_iot_domain_group", + "iot.create_iot_flow_runtime": "oci.iot.IotClient.create_iot_flow_runtime", + "iot.deactivate_iot_flow_runtime": "oci.iot.IotClient.deactivate_iot_flow_runtime", "iot.delete_digital_twin_adapter": "oci.iot.IotClient.delete_digital_twin_adapter", "iot.delete_digital_twin_instance": "oci.iot.IotClient.delete_digital_twin_instance", "iot.delete_digital_twin_model": "oci.iot.IotClient.delete_digital_twin_model", "iot.delete_digital_twin_relationship": "oci.iot.IotClient.delete_digital_twin_relationship", "iot.delete_iot_domain": "oci.iot.IotClient.delete_iot_domain", "iot.delete_iot_domain_group": "oci.iot.IotClient.delete_iot_domain_group", + "iot.delete_iot_flow_runtime": "oci.iot.IotClient.delete_iot_flow_runtime", "iot.get_digital_twin_adapter": "oci.iot.IotClient.get_digital_twin_adapter", "iot.get_digital_twin_instance": "oci.iot.IotClient.get_digital_twin_instance", "iot.get_digital_twin_instance_content": "oci.iot.IotClient.get_digital_twin_instance_content", @@ -27,6 +32,8 @@ "iot.get_digital_twin_relationship": "oci.iot.IotClient.get_digital_twin_relationship", "iot.get_iot_domain": "oci.iot.IotClient.get_iot_domain", "iot.get_iot_domain_group": "oci.iot.IotClient.get_iot_domain_group", + "iot.get_iot_flow_runtime": "oci.iot.IotClient.get_iot_flow_runtime", + "iot.get_iot_flow_runtime_flows": "oci.iot.IotClient.get_iot_flow_runtime_flows", "iot.get_work_request": "oci.iot.IotClient.get_work_request", "iot.invoke_raw_command": "oci.iot.IotClient.invoke_raw_command", "iot.list_digital_twin_adapters": "oci.iot.IotClient.list_digital_twin_adapters", @@ -35,6 +42,7 @@ "iot.list_digital_twin_relationships": "oci.iot.IotClient.list_digital_twin_relationships", "iot.list_iot_domain_groups": "oci.iot.IotClient.list_iot_domain_groups", "iot.list_iot_domains": "oci.iot.IotClient.list_iot_domains", + "iot.list_iot_flow_runtimes": "oci.iot.IotClient.list_iot_flow_runtimes", "iot.list_work_request_errors": "oci.iot.IotClient.list_work_request_errors", "iot.list_work_request_logs": "oci.iot.IotClient.list_work_request_logs", "iot.list_work_requests": "oci.iot.IotClient.list_work_requests", @@ -44,4 +52,6 @@ "iot.update_digital_twin_relationship": "oci.iot.IotClient.update_digital_twin_relationship", "iot.update_iot_domain": "oci.iot.IotClient.update_iot_domain", "iot.update_iot_domain_group": "oci.iot.IotClient.update_iot_domain_group", + "iot.update_iot_flow_runtime": "oci.iot.IotClient.update_iot_flow_runtime", + "iot.update_iot_flow_runtime_flows": "oci.iot.IotClient.update_iot_flow_runtime_flows", } diff --git a/setup.py b/setup.py index ca0060ecf..2a113f25a 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def open_relative(*path): readme = f.read() requires = [ - 'oci==2.185.0', + 'oci==2.185.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 f20e81473..58f555e86 100644 --- a/src/oci_cli/service_mapping.py +++ b/src/oci_cli/service_mapping.py @@ -168,6 +168,11 @@ "Oracle Cloud Migrations", "Others" ], + "cluster-health": [ + "cluster_health", + "ITV Control Plane - Diagnosis Store", + "Others" + ], "compute": [ "core", "Compute Service", @@ -589,7 +594,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 8f790a646..587d1c75e 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.91.0' +__version__ = '3.92.0' diff --git a/tests/resources/json_ignore_command_list.txt b/tests/resources/json_ignore_command_list.txt index c7991265e..872111c8c 100644 --- a/tests/resources/json_ignore_command_list.txt +++ b/tests/resources/json_ignore_command_list.txt @@ -615,3 +615,5 @@ db, database, create-from-backup data-safe, private-endpoint, update db, database, create-from-database db, database, create-database-from-database +iot, iot-flow-runtime, update-iot-flow-runtime-flows +iot, flow-runtime, update-flows \ No newline at end of file