From b9333bdcdcabdd10b8a4ef340ab4ebfc1d5cf5ae Mon Sep 17 00:00:00 2001 From: OCI DEX Release Bot Automation Date: Tue, 26 May 2026 19:29:33 +0000 Subject: [PATCH] Releasing version 3.84.0 Co-authored-by: Harsh Kumar --- CHANGELOG.rst | 135 ++ requirements.txt | 2 +- .../clusterplacementgroupscp_cli_extended.py | 66 +- .../containerengine_cli_extended.py | 10 + .../generated/containerengine_cli.py | 58 +- .../oci_cli_compute/generated/compute_cli.py | 5 +- .../datascience_cli_extended.py | 52 - .../generated/datascience_cli.py | 1338 ++++++++++++++--- .../tests/util/generated/command_to_api.py | 7 + .../generated/database_cli.py | 312 ++-- .../generated/goldengate_cli.py | 327 +++- .../tests/util/generated/command_to_api.py | 3 + .../generated/networkfirewall_cli.py | 95 +- .../tests/util/generated/command_to_api.py | 1 + setup.py | 2 +- src/oci_cli/cli_util.py | 8 +- src/oci_cli/service_mapping.py | 2 +- src/oci_cli/version.py | 2 +- tests/resources/json_ignore_command_list.txt | 1 + tests/unit/test_cli_util.py | 84 ++ 20 files changed, 2076 insertions(+), 434 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 974c6384a..f8468602f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,141 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `__. +3.84.0 - 2026-05-26 +------------------- +Added +~~~~~ + +* Database service + + * Support for optional parameter ``--plan-intent`` + + * ``oci db action-param-values-summary list-params-for-action-type --plan-intent`` + * ``oci db scheduling-plan create --plan-intent`` + * ``oci db scheduling-plan list --plan-intent`` + + * Supports for following optional parameters ``--db-split-threshold``, ``--distribution-affinity``, ``--net-services-architecture`` and ``--vm-failover-reservation`` + + * ``oci db autonomous-container-database update --db-split-threshold --distribution-affinity --net-services-architecture --vm-failover-reservation`` + + * Support for optional parameters ``--distribution-algorithm`` and ``--sga-percentage`` + + * ``oci db autonomous-vm-cluster create --distribution-algorithm --sga-percentage`` + * ``oci db autonomous-vm-cluster update --distribution-algorithm --sga-percentage`` + * ``oci db cloud-autonomous-vm-cluster create --distribution-algorithm --sga-percentage`` + * ``oci db cloud-autonomous-vm-cluster update --distribution-algorithm --sga-percentage`` + + * Support for optional parameters ``--is-mtls-enabled``, ``--scan-listener-port-non-tls``, ``--scan-listener-port-tls`` and ``--time-zone`` + + * ``oci db autonomous-vm-cluster update --is-mtls-enabled --scan-listener-port-non-tls --scan-listener-port-tls --time-zone`` + + * Support for optional parameters ``--cluster-time-zone``, ``--is-mtls-enabled-vm-cluster``, ``--scan-listener-port-non-tls`` and ``--scan-listener-port-tls`` + + * ``oci db cloud-autonomous-vm-cluster update --cluster-time-zone --is-mtls-enabled-vm-cluster --scan-listener-port-non-tls --scan-listener-port-tls`` + + * Support for optional parameter ``--maintenance-version-preferences`` + + * ``oci db cloud-exa-infra create --maintenance-version-preferences`` + * ``oci db cloud-exa-infra update --maintenance-version-preferences`` + * ``oci db exadata-infrastructure create --maintenance-version-preferences`` + * ``oci db exadata-infrastructure update --maintenance-version-preferences`` + + * Support for optional parameter ``--cadence`` + + * ``oci db scheduling-policy list --cadence`` + +* Cluster Placement Groups service + + * Support for selecting compute shape configuration during Cluster Placement Group creation + + * ``oci cpg cluster-placement-group create`` + +* Data Science service + + * Support for Compute Target, to create and manage reusable managed compute capacity for Data Science workloads + + * ``oci data-science compute-target create`` + * ``oci data-science compute-target get`` + * ``oci data-science compute-target list`` + * ``oci data-science compute-target update`` + * ``oci data-science compute-target delete`` + * ``oci data-science compute-target change-compartment`` + * ``oci data-science compute-target-shape list`` + + * Support for Managed Compute Cluster as a Compute Target type + + * ``oci data-science compute-target create-compute-target-managed-compute-cluster-compute-configuration-details`` + * ``oci data-science compute-target update-compute-target-update-managed-compute-cluster-configuration-details`` + + * Support for creating and updating Jobs using Managed Compute Cluster infrastructure + + * ``oci data-science job create-job-managed-compute-cluster-job-infrastructure-configuration-details`` + * ``oci data-science job update-job-managed-compute-cluster-job-infrastructure-configuration-details`` + * ``oci data-science job-run create-job-run-managed-compute-cluster-job-infrastructure-configuration-details`` + + * Support for creating and updating Model Deployments using flex configuration details + + * ``oci data-science model-deployment create-model-deployment-single-model-deployment-flex-configuration-details`` + * ``oci data-science model-deployment update-model-deployment-update-single-model-deployment-flex-configuration-details`` + +* Container Engine for Kubernetes service + + * Support for Zero Trust Packet Routing + + * ``oci ce node-pool create --primary-vnic`` + * ``oci ce cluster create --endpoint-security-attributes`` + +* Support for new optional parameter ``--remaining-local-volume-in-gbs-greater-than-or-equal-to`` in Compute Service + + * ``oci compute dedicated-vm-host list --remaining-local-volume-in-gbs-greater-than-or-equal-to`` + +* Network Firewall service + + * Support for Network Firewall Health Status APIs + + * ``oci network-firewall network-firewall-health-status`` + + * Support for new optional parameter ``--securityattributes`` + + * ``oci network-firewall create --securityattributes`` + + * Support for new optional parameter ``--secrets`` + + * ``oci network-firewall decryption-rule create --secrets`` + +* GoldenGate service + + * Support for Veridata deployment type + + * ``oci goldengate deployment create --deployment-type`` + + * Support for clone operation for ZeroETL pipelines + + * ``oci goldengate pipeline clone`` + + * Support for ``cpuCoreCount`` and ``autoScaling`` for ZeroETL pipelines + + * ``oci goldengate pipeline create-zero-etl-pipeline --cpu-core-count --is-auto-scaling-enabled`` + * ``oci goldengate pipeline update-zero-etl-pipeline --cpu-core-count --is-auto-scaling-enabled`` + + * Support for Disaster Recovery (DR) deployment operations + + * ``oci goldengate deployment create --disaster-recovery-status`` + * ``oci goldengate deployment switchover-deployment-peer --mode`` + * ``oci goldengate deployment generate-disaster-recovery-precheck-report`` + * ``oci goldengate deployment get-disaster-recovery-precheck-report`` + +Changed +~~~~~~~ + +* Data Science service + + * [BREAKING] Removed support for IDCS authentication modes from ML Applications resources + + * ``oci data-science ml-app-instance create-ml-application-instance-create-idcs-auth-configuration-details`` + * ``oci data-science ml-app-instance create-ml-application-instance-create-idcs-custom-service-auth-configuration-details`` + + 3.83.0 - 2026-05-19 ------------------- Added diff --git a/requirements.txt b/requirements.txt index 0377c4241..27f375dad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ Jinja2>=3.1.5,<4.0.0; python_version >= '3.7' jmespath>=0.10.0,<=1.0.1 ndg-httpsclient==0.4.2 mock==2.0.0 -oci==2.175.0 +oci==2.176.0 packaging>=22.0,<25.0; python_version > '3.8' packaging==20.2; python_version <= '3.8' pluggy==0.13.0 diff --git a/services/cluster_placement_groups/src/oci_cli_cluster_placement_groups_cp/clusterplacementgroupscp_cli_extended.py b/services/cluster_placement_groups/src/oci_cli_cluster_placement_groups_cp/clusterplacementgroupscp_cli_extended.py index 289ebe220..3fd1f7e50 100644 --- a/services/cluster_placement_groups/src/oci_cli_cluster_placement_groups_cp/clusterplacementgroupscp_cli_extended.py +++ b/services/cluster_placement_groups/src/oci_cli_cluster_placement_groups_cp/clusterplacementgroupscp_cli_extended.py @@ -8,6 +8,68 @@ from oci_cli import cli_util # noqa: F401 from oci_cli import custom_types # noqa: F401 from oci_cli import json_skeleton_utils # noqa: F401 +# Fix the JSON skeleton generation for capabilities +_original_get_example_object_for_tags = json_skeleton_utils.get_example_object_for_tags + + +def _get_example_object_for_tags_patched(targeted_complex_param): + """Patched to return custom capabilities example with additionalDetails as object""" + result = _original_get_example_object_for_tags(targeted_complex_param) + if result is not None: + return result + if targeted_complex_param == "capabilities": + return { + "items": [ + { + "name": "string", + "service": "string", + "additionalDetails": {"count": 0, "memoryInGBs": 0.0, "nvmes": 0, "ocpus": 0.0, "serviceType": "COMPUTE"} + }, + {"name": "string", "service": "string", "additionalDetails": None} + ] + } + return None + + +json_skeleton_utils.get_example_object_for_tags = _get_example_object_for_tags_patched + + +def _convert_additional_details_to_object(capabilities): + """ + Convert additionalDetails from array to JSON object in capabilities structure. + If additionalDetails is an array, extract the first JSON object from it. + The function always returns a JSON string since the generated code expects to parse it. + """ + if not capabilities: + return capabilities + try: + # Parse capabilities if it's a string + if isinstance(capabilities, str): + capabilities_data = json.loads(capabilities) + else: + capabilities_data = capabilities + # Process capabilities items + if isinstance(capabilities_data, dict) and 'items' in capabilities_data: + items = capabilities_data['items'] + if isinstance(items, list): + for item in items: + if isinstance(item, dict) and 'additionalDetails' in item: + additional_details = item['additionalDetails'] + # If additionalDetails is an array, extract the first object + if isinstance(additional_details, list): + # Find the first dictionary object in the array + for element in additional_details: + if isinstance(element, dict): + item['additionalDetails'] = element + break + else: + # If no object found, set to None + item['additionalDetails'] = None + # Always return as JSON string since generated code will parse it + return json.dumps(capabilities_data) + except (json.JSONDecodeError, TypeError, AttributeError): + # If parsing fails, return original + return capabilities # oci cluster-placement-groups work-request-log-entry list-work-request-logs -> oci cluster-placement-groups work-request-log-entry list @@ -30,7 +92,9 @@ def create_cluster_placement_group_extended(ctx, **kwargs): if 'type' in kwargs: kwargs['cluster_placement_group_type'] = kwargs['type'] kwargs.pop('type') - + # Convert additionalDetails from array to JSON object in capabilities + if 'capabilities' in kwargs and kwargs['capabilities'] is not None: + kwargs['capabilities'] = _convert_additional_details_to_object(kwargs['capabilities']) ctx.invoke(clusterplacementgroupscp_cli.create_cluster_placement_group, **kwargs) diff --git a/services/container_engine/src/oci_cli_container_engine/containerengine_cli_extended.py b/services/container_engine/src/oci_cli_container_engine/containerengine_cli_extended.py index f15559044..372c3894d 100644 --- a/services/container_engine/src/oci_cli_container_engine/containerengine_cli_extended.py +++ b/services/container_engine/src/oci_cli_container_engine/containerengine_cli_extended.py @@ -137,12 +137,14 @@ def generate_token(ctx, from_json, cluster_id): security groups (NSGs) to apply to the cluster endpoint. You must also specify --endpoint-subnet-id.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--endpoint-public-ip-enabled', type=click.BOOL, help="""Whether the cluster should be assigned a public\ IP address. Defaults to false. If set to true on a private subnet, the cluster provisioning will fail. You must also specify --endpoint-subnet-id.""") +@cli_util.option('--endpoint-security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""[Security attributes] are labels for a resource that can be referenced in a [Zero Trust Packet Routing] (ZPR) policy to control access to ZPR-supported resources.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--ip-families', type=custom_types.CLI_COMPLEX_TYPE, help="""A list of IP families for the cluster. Example: '[\"IPv4\", \"IPv6\"]'""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @json_skeleton_utils.get_cli_json_input_option( {'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'service-lb-subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'endpoint-nsg-ids': {'module': 'container_engine', 'class': 'list[string]'}, + 'endpoint-security-attributes': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'service-lb-defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'service-lb-freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'persistent-volume-defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, @@ -159,6 +161,7 @@ def generate_token(ctx, from_json, cluster_id): 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'service-lb-subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'endpoint-nsg-ids': {'module': 'container_engine', 'class': 'list[string]'}, + 'endpoint-security-attributes': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'service-lb-defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'service-lb-freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'persistent-volume-defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, @@ -303,6 +306,10 @@ def create_cluster(ctx, **kwargs): raise click.UsageError( 'Cannot specify --endpoint-public-ip-enabled without --endpoint-subnet-id' ) + if kwargs.get('endpoint_security_attributes') and not kwargs.get('endpoint_subnet_id'): + raise click.UsageError( + 'Cannot specify --endpoint-security-attributes without --endpoint-subnet-id' + ) if 'endpoint_subnet_id' in kwargs and kwargs['endpoint_subnet_id'] is not None: kwargs['endpoint_config'] = {} @@ -311,9 +318,12 @@ def create_cluster(ctx, **kwargs): kwargs['endpoint_config']['nsgIds'] = cli_util.parse_json_parameter("endpoint_nsg_ids", kwargs['endpoint_nsg_ids']) if 'endpoint_public_ip_enabled' in kwargs and kwargs['endpoint_public_ip_enabled'] is not None: kwargs['endpoint_config']['isPublicIpEnabled'] = kwargs['endpoint_public_ip_enabled'] + if 'endpoint_security_attributes' in kwargs and kwargs['endpoint_security_attributes'] is not None: + kwargs['endpoint_config']['securityAttributes'] = cli_util.parse_json_parameter("endpoint_security_attributes", kwargs['endpoint_security_attributes']) kwargs.pop('endpoint_subnet_id', None) kwargs.pop('endpoint_nsg_ids', None) kwargs.pop('endpoint_public_ip_enabled', None) + kwargs.pop('endpoint_security_attributes', None) # It seems like the service needs options param even if it is empty so leave it when invoking the create command diff --git a/services/container_engine/src/oci_cli_container_engine/generated/containerengine_cli.py b/services/container_engine/src/oci_cli_container_engine/generated/containerengine_cli.py index 280b1fd75..212326e96 100644 --- a/services/container_engine/src/oci_cli_container_engine/generated/containerengine_cli.py +++ b/services/container_engine/src/oci_cli_container_engine/generated/containerengine_cli.py @@ -416,15 +416,16 @@ def create_kubeconfig(ctx, from_json, file, cluster_id, token_version, expiratio This option is a JSON list with items of type NodePoolSecondaryVnicDetails. For documentation on NodePoolSecondaryVnicDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/containerengine/20180222/datatypes/NodePoolSecondaryVnicDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--network-launch-type', type=custom_types.CliCaseInsensitiveChoice(["VFIO", "E1000", "PARAVIRTUALIZED"]), help=u"""Emulation type for the physical network interface card (NIC) for nodes""") +@cli_util.option('--primary-vnic', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.get_cli_json_input_option({'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.wrap_exceptions -def create_node_pool(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, cluster_id, name, node_shape, kubernetes_version, node_metadata, node_image_name, node_source_details, node_shape_config, initial_node_labels, ssh_public_key, quantity_per_subnet, subnet_ids, node_config_details, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type): +def create_node_pool(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, cluster_id, name, node_shape, kubernetes_version, node_metadata, node_image_name, node_source_details, node_shape_config, initial_node_labels, ssh_public_key, quantity_per_subnet, subnet_ids, node_config_details, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type, primary_vnic): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -483,6 +484,9 @@ def create_node_pool(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte if network_launch_type is not None: _details['networkLaunchType'] = network_launch_type + if primary_vnic is not None: + _details['primaryVnic'] = cli_util.parse_json_parameter("primary_vnic", primary_vnic) + client = cli_util.build_client('container_engine', 'container_engine', ctx) result = client.create_node_pool( create_node_pool_details=_details, @@ -543,16 +547,17 @@ def create_node_pool(ctx, from_json, wait_for_state, max_wait_seconds, wait_inte This option is a JSON list with items of type NodePoolSecondaryVnicDetails. For documentation on NodePoolSecondaryVnicDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/containerengine/20180222/datatypes/NodePoolSecondaryVnicDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--network-launch-type', type=custom_types.CliCaseInsensitiveChoice(["VFIO", "E1000", "PARAVIRTUALIZED"]), help=u"""Emulation type for the physical network interface card (NIC) for nodes""") +@cli_util.option('--primary-vnic', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--node-source-details-boot-volume-size-in-gbs', type=click.INT, help=u"""The size of the boot volume in GBs. Minimum value is 50 GB. See [here] for max custom boot volume sizing and OS-specific requirements.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.get_cli_json_input_option({'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'CreateNodeShapeConfigDetails'}, 'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'CreateNodePoolNodeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.wrap_exceptions -def create_node_pool_node_source_via_image_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, cluster_id, name, node_shape, node_source_details_image_id, kubernetes_version, node_metadata, node_image_name, node_shape_config, initial_node_labels, ssh_public_key, quantity_per_subnet, subnet_ids, node_config_details, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type, node_source_details_boot_volume_size_in_gbs): +def create_node_pool_node_source_via_image_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, cluster_id, name, node_shape, node_source_details_image_id, kubernetes_version, node_metadata, node_image_name, node_shape_config, initial_node_labels, ssh_public_key, quantity_per_subnet, subnet_ids, node_config_details, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type, primary_vnic, node_source_details_boot_volume_size_in_gbs): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -610,6 +615,9 @@ def create_node_pool_node_source_via_image_details(ctx, from_json, wait_for_stat if network_launch_type is not None: _details['networkLaunchType'] = network_launch_type + if primary_vnic is not None: + _details['primaryVnic'] = cli_util.parse_json_parameter("primary_vnic", primary_vnic) + if node_source_details_boot_volume_size_in_gbs is not None: _details['nodeSourceDetails']['bootVolumeSizeInGBs'] = node_source_details_boot_volume_size_in_gbs @@ -2658,16 +2666,17 @@ def update_cluster(ctx, from_json, force, wait_for_state, max_wait_seconds, wait @cli_util.option('--cluster-id', required=True, help=u"""The OCID of the cluster.""") @cli_util.option('--nsg-ids', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A list of the OCIDs of the network security groups (NSGs) to apply to the cluster endpoint. For more information about NSGs, see [NetworkSecurityGroup].""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--is-public-ip-enabled', type=click.BOOL, help=u"""Whether the cluster should be assigned a public IP address. Defaults to false. If set to true on a private subnet, the cluster update will fail.""") +@cli_util.option('--security-attributes', type=custom_types.CLI_COMPLEX_TYPE, help=u"""[Security attributes] are labels for a resource that can be referenced in a [Zero Trust Packet Routing] (ZPR) policy to control access to ZPR-supported resources.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'nsg-ids': {'module': 'container_engine', 'class': 'list[string]'}}) +@json_skeleton_utils.get_cli_json_input_option({'nsg-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'security-attributes': {'module': 'container_engine', '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={'nsg-ids': {'module': 'container_engine', 'class': 'list[string]'}}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'nsg-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'security-attributes': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}}) @cli_util.wrap_exceptions -def update_cluster_endpoint_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, cluster_id, nsg_ids, is_public_ip_enabled, if_match): +def update_cluster_endpoint_config(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, cluster_id, nsg_ids, is_public_ip_enabled, security_attributes, if_match): if isinstance(cluster_id, six.string_types) and len(cluster_id.strip()) == 0: raise click.UsageError('Parameter --cluster-id cannot be whitespace or empty string') @@ -2685,6 +2694,9 @@ def update_cluster_endpoint_config(ctx, from_json, wait_for_state, max_wait_seco if is_public_ip_enabled is not None: _details['isPublicIpEnabled'] = is_public_ip_enabled + if security_attributes is not None: + _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) + client = cli_util.build_client('container_engine', 'container_engine', ctx) result = client.update_cluster_endpoint_config( cluster_id=cluster_id, @@ -2744,6 +2756,7 @@ def update_cluster_endpoint_config(ctx, from_json, wait_for_state, max_wait_seco This option is a JSON list with items of type NodePoolSecondaryVnicDetails. For documentation on NodePoolSecondaryVnicDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/containerengine/20180222/datatypes/NodePoolSecondaryVnicDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--network-launch-type', type=custom_types.CliCaseInsensitiveChoice(["VFIO", "E1000", "PARAVIRTUALIZED"]), help=u"""Emulation type for the physical network interface card (NIC) for nodes""") +@cli_util.option('--primary-vnic', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--override-eviction-grace-duration', help=u"""Duration after which OKE will give up eviction of the pods on the node. PT0M will indicate you want to delete the node without cordon and drain. Default PT60M, Min PT0M, Max: PT60M. Format ISO 8601 e.g PT30M""") @cli_util.option('--is-force-deletion-after-override-grace-duration', type=click.BOOL, help=u"""If the underlying compute instance should be deleted if you cannot evict all the pods in grace period""") @@ -2751,18 +2764,18 @@ def update_cluster_endpoint_config(ctx, from_json, wait_for_state, max_wait_seco @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.get_cli_json_input_option({'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-source-details': {'module': 'container_engine', 'class': 'NodeSourceDetails'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.wrap_exceptions -def update_node_pool(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, node_pool_id, name, kubernetes_version, initial_node_labels, quantity_per_subnet, subnet_ids, node_config_details, node_metadata, node_source_details, ssh_public_key, node_shape, node_shape_config, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type, if_match, override_eviction_grace_duration, is_force_deletion_after_override_grace_duration): +def update_node_pool(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, node_pool_id, name, kubernetes_version, initial_node_labels, quantity_per_subnet, subnet_ids, node_config_details, node_metadata, node_source_details, ssh_public_key, node_shape, node_shape_config, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type, primary_vnic, if_match, override_eviction_grace_duration, is_force_deletion_after_override_grace_duration): if isinstance(node_pool_id, six.string_types) and len(node_pool_id.strip()) == 0: raise click.UsageError('Parameter --node-pool-id cannot be whitespace or empty string') if not force: - if initial_node_labels or subnet_ids or node_config_details or node_metadata or node_source_details or node_shape_config or freeform_tags or defined_tags or node_eviction_node_pool_settings or node_pool_cycling_details or secondary_vnics: - if not click.confirm("WARNING: Updates to initial-node-labels and subnet-ids and node-config-details and node-metadata and node-source-details and node-shape-config and freeform-tags and defined-tags and node-eviction-node-pool-settings and node-pool-cycling-details and secondary-vnics will replace any existing values. Are you sure you want to continue?"): + if initial_node_labels or subnet_ids or node_config_details or node_metadata or node_source_details or node_shape_config or freeform_tags or defined_tags or node_eviction_node_pool_settings or node_pool_cycling_details or secondary_vnics or primary_vnic: + if not click.confirm("WARNING: Updates to initial-node-labels and subnet-ids and node-config-details and node-metadata and node-source-details and node-shape-config and freeform-tags and defined-tags and node-eviction-node-pool-settings and node-pool-cycling-details and secondary-vnics and primary-vnic will replace any existing values. Are you sure you want to continue?"): ctx.abort() kwargs = {} @@ -2827,6 +2840,9 @@ def update_node_pool(ctx, from_json, force, wait_for_state, max_wait_seconds, wa if network_launch_type is not None: _details['networkLaunchType'] = network_launch_type + if primary_vnic is not None: + _details['primaryVnic'] = cli_util.parse_json_parameter("primary_vnic", primary_vnic) + client = cli_util.build_client('container_engine', 'container_engine', ctx) result = client.update_node_pool( node_pool_id=node_pool_id, @@ -2886,6 +2902,7 @@ def update_node_pool(ctx, from_json, force, wait_for_state, max_wait_seconds, wa This option is a JSON list with items of type NodePoolSecondaryVnicDetails. For documentation on NodePoolSecondaryVnicDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/containerengine/20180222/datatypes/NodePoolSecondaryVnicDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--network-launch-type', type=custom_types.CliCaseInsensitiveChoice(["VFIO", "E1000", "PARAVIRTUALIZED"]), help=u"""Emulation type for the physical network interface card (NIC) for nodes""") +@cli_util.option('--primary-vnic', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--override-eviction-grace-duration', help=u"""Duration after which OKE will give up eviction of the pods on the node. PT0M will indicate you want to delete the node without cordon and drain. Default PT60M, Min PT0M, Max: PT60M. Format ISO 8601 e.g PT30M""") @cli_util.option('--is-force-deletion-after-override-grace-duration', type=click.BOOL, help=u"""If the underlying compute instance should be deleted if you cannot evict all the pods in grace period""") @@ -2894,18 +2911,18 @@ def update_node_pool(ctx, from_json, force, wait_for_state, max_wait_seconds, wa @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.get_cli_json_input_option({'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'initial-node-labels': {'module': 'container_engine', 'class': 'list[KeyValue]'}, 'subnet-ids': {'module': 'container_engine', 'class': 'list[string]'}, 'node-config-details': {'module': 'container_engine', 'class': 'UpdateNodePoolNodeConfigDetails'}, 'node-metadata': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'node-shape-config': {'module': 'container_engine', 'class': 'UpdateNodeShapeConfigDetails'}, 'freeform-tags': {'module': 'container_engine', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'container_engine', 'class': 'dict(str, dict(str, object))'}, 'node-eviction-node-pool-settings': {'module': 'container_engine', 'class': 'NodeEvictionNodePoolSettings'}, 'node-pool-cycling-details': {'module': 'container_engine', 'class': 'NodePoolCyclingDetails'}, 'secondary-vnics': {'module': 'container_engine', 'class': 'list[NodePoolSecondaryVnicDetails]'}, 'primary-vnic': {'module': 'container_engine', 'class': 'NodePoolPrimaryVnicDetails'}}) @cli_util.wrap_exceptions -def update_node_pool_node_source_via_image_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, node_pool_id, node_source_details_image_id, name, kubernetes_version, initial_node_labels, quantity_per_subnet, subnet_ids, node_config_details, node_metadata, ssh_public_key, node_shape, node_shape_config, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type, if_match, override_eviction_grace_duration, is_force_deletion_after_override_grace_duration, node_source_details_boot_volume_size_in_gbs): +def update_node_pool_node_source_via_image_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, node_pool_id, node_source_details_image_id, name, kubernetes_version, initial_node_labels, quantity_per_subnet, subnet_ids, node_config_details, node_metadata, ssh_public_key, node_shape, node_shape_config, freeform_tags, defined_tags, node_eviction_node_pool_settings, node_pool_cycling_details, secondary_vnics, network_launch_type, primary_vnic, if_match, override_eviction_grace_duration, is_force_deletion_after_override_grace_duration, node_source_details_boot_volume_size_in_gbs): if isinstance(node_pool_id, six.string_types) and len(node_pool_id.strip()) == 0: raise click.UsageError('Parameter --node-pool-id cannot be whitespace or empty string') if not force: - if initial_node_labels or subnet_ids or node_config_details or node_metadata or node_shape_config or freeform_tags or defined_tags or node_eviction_node_pool_settings or node_pool_cycling_details or secondary_vnics: - if not click.confirm("WARNING: Updates to initial-node-labels and subnet-ids and node-config-details and node-metadata and node-shape-config and freeform-tags and defined-tags and node-eviction-node-pool-settings and node-pool-cycling-details and secondary-vnics will replace any existing values. Are you sure you want to continue?"): + if initial_node_labels or subnet_ids or node_config_details or node_metadata or node_shape_config or freeform_tags or defined_tags or node_eviction_node_pool_settings or node_pool_cycling_details or secondary_vnics or primary_vnic: + if not click.confirm("WARNING: Updates to initial-node-labels and subnet-ids and node-config-details and node-metadata and node-shape-config and freeform-tags and defined-tags and node-eviction-node-pool-settings and node-pool-cycling-details and secondary-vnics and primary-vnic will replace any existing values. Are you sure you want to continue?"): ctx.abort() kwargs = {} @@ -2969,6 +2986,9 @@ def update_node_pool_node_source_via_image_details(ctx, from_json, force, wait_f if network_launch_type is not None: _details['networkLaunchType'] = network_launch_type + if primary_vnic is not None: + _details['primaryVnic'] = cli_util.parse_json_parameter("primary_vnic", primary_vnic) + if node_source_details_boot_volume_size_in_gbs is not None: _details['nodeSourceDetails']['bootVolumeSizeInGBs'] = node_source_details_boot_volume_size_in_gbs diff --git a/services/core/src/oci_cli_compute/generated/compute_cli.py b/services/core/src/oci_cli_compute/generated/compute_cli.py index 99431120a..18dd8161e 100644 --- a/services/core/src/oci_cli_compute/generated/compute_cli.py +++ b/services/core/src/oci_cli_compute/generated/compute_cli.py @@ -10594,6 +10594,7 @@ def list_dedicated_vm_host_shapes(ctx, from_json, all_pages, page_size, compartm @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order is case sensitive.""") @cli_util.option('--remaining-memory-in-gbs-greater-than-or-equal-to', type=click.FLOAT, help=u"""The remaining memory of the dedicated VM host, in GBs.""") @cli_util.option('--remaining-ocpus-greater-than-or-equal-to', type=click.FLOAT, help=u"""The available OCPUs of the dedicated VM host.""") +@cli_util.option('--remaining-local-volume-in-gbs-greater-than-or-equal-to', type=click.FLOAT, help=u"""The remaining local volume of the dedicated VM host, in GBs.""") @cli_util.option('--is-memory-encryption-enabled', type=click.BOOL, help=u"""A filter to return only confidential Dedicated VM hosts (DVMH) or confidential VM instances on DVMH.""") @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.""") @@ -10602,7 +10603,7 @@ def list_dedicated_vm_host_shapes(ctx, from_json, all_pages, page_size, compartm @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'core', 'class': 'list[DedicatedVmHostSummary]'}) @cli_util.wrap_exceptions -def list_dedicated_vm_hosts(ctx, from_json, all_pages, page_size, compartment_id, availability_domain, lifecycle_state, display_name, instance_shape_name, limit, page, sort_by, sort_order, remaining_memory_in_gbs_greater_than_or_equal_to, remaining_ocpus_greater_than_or_equal_to, is_memory_encryption_enabled): +def list_dedicated_vm_hosts(ctx, from_json, all_pages, page_size, compartment_id, availability_domain, lifecycle_state, display_name, instance_shape_name, limit, page, sort_by, sort_order, remaining_memory_in_gbs_greater_than_or_equal_to, remaining_ocpus_greater_than_or_equal_to, remaining_local_volume_in_gbs_greater_than_or_equal_to, is_memory_encryption_enabled): if all_pages and limit: raise click.UsageError('If you provide the --all option you cannot provide the --limit option') @@ -10630,6 +10631,8 @@ def list_dedicated_vm_hosts(ctx, from_json, all_pages, page_size, compartment_id kwargs['remaining_memory_in_gbs_greater_than_or_equal_to'] = remaining_memory_in_gbs_greater_than_or_equal_to if remaining_ocpus_greater_than_or_equal_to is not None: kwargs['remaining_ocpus_greater_than_or_equal_to'] = remaining_ocpus_greater_than_or_equal_to + if remaining_local_volume_in_gbs_greater_than_or_equal_to is not None: + kwargs['remaining_local_volume_in_gbs_greater_than_or_equal_to'] = remaining_local_volume_in_gbs_greater_than_or_equal_to if is_memory_encryption_enabled is not None: kwargs['is_memory_encryption_enabled'] = is_memory_encryption_enabled kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) diff --git a/services/data_science/src/oci_cli_data_science/datascience_cli_extended.py b/services/data_science/src/oci_cli_data_science/datascience_cli_extended.py index ff6fe6ffb..2f67b1a27 100644 --- a/services/data_science/src/oci_cli_data_science/datascience_cli_extended.py +++ b/services/data_science/src/oci_cli_data_science/datascience_cli_extended.py @@ -660,18 +660,10 @@ def update_data_science_private_endpoint_extended(ctx, **kwargs): cli_util.rename_command(datascience_cli, datascience_cli.ml_application_instance_group, datascience_cli.trigger_ml_application_instance_flow, "trigger") -# oci data-science ml-app-instance create-ml-application-instance-create-idcs-auth-configuration-details -> oci data-science ml-app-instance create-with-idcs-auth -cli_util.rename_command(datascience_cli, datascience_cli.ml_application_instance_group, datascience_cli.create_ml_application_instance_create_idcs_auth_configuration_details, "create-with-idcs-auth") - - # oci data-science ml-app-instance create-ml-application-instance-create-iam-auth-configuration-create-details -> oci data-science ml-app-instance create-with-iam-auth cli_util.rename_command(datascience_cli, datascience_cli.ml_application_instance_group, datascience_cli.create_ml_application_instance_create_iam_auth_configuration_create_details, "create-with-iam-auth") -# oci data-science ml-app-instance create-ml-application-instance-create-idcs-custom-service-auth-configuration-details -> oci data-science ml-app-instance create-with-custom-service-idcs-auth -cli_util.rename_command(datascience_cli, datascience_cli.ml_application_instance_group, datascience_cli.create_ml_application_instance_create_idcs_custom_service_auth_configuration_details, "create-with-custom-service-idcs-auth") - - # oci data-science ml-application-implementation -> oci data-science ml-app-implementation cli_util.rename_command(datascience_cli, datascience_cli.data_science_root_group, datascience_cli.ml_application_implementation_group, "ml-app-implementation") @@ -841,50 +833,6 @@ def create_ml_application_instance(ctx, **kwargs): ctx.invoke(datascience_cli.create_ml_application_instance, **kwargs) -# Rename oci data-science ml-app-instance create_ml_application_instance_create_idcs_auth_configuration_details --ml-application-id --ml-application-implementation-id -# to oci data-science ml-app-instance create_ml_application_instance_create_idcs_auth_configuration_details --ml-app-id --ml-app-implementation-id -@cli_util.copy_params_from_generated_command(datascience_cli.create_ml_application_instance_create_idcs_auth_configuration_details, params_to_exclude=['ml_application_id', 'ml_application_implementation_id']) -@datascience_cli.ml_application_instance_group.command(name=datascience_cli.create_ml_application_instance_create_idcs_auth_configuration_details.name, help=datascience_cli.create_ml_application_instance_create_idcs_auth_configuration_details.help) -@cli_util.option('--ml-app-id', required=True, help=u"""The OCID of ML Application. This resource is an instance of ML Application referenced by this OCID.""") -@cli_util.option('--ml-app-implementation-id', help=u"""The OCID of ML Application Implementation selected as a certain solution for a given ML problem (ML Application)""") -@click.pass_context -def create_ml_application_instance_create_idcs_auth_configuration_details(ctx, **kwargs): - - if isinstance(kwargs['ml_app_id'], six.string_types) and len(kwargs['ml_app_id'].strip()) == 0: - raise click.UsageError('Parameter --ml-app-id cannot be whitespace or empty string') - - if 'ml_app_id' in kwargs: - kwargs['ml_application_id'] = kwargs['ml_app_id'] - del kwargs['ml_app_id'] - if 'ml_app_implementation_id' in kwargs: - kwargs['ml_application_implementation_id'] = kwargs['ml_app_implementation_id'] - del kwargs['ml_app_implementation_id'] - - ctx.invoke(datascience_cli.create_ml_application_instance_create_idcs_auth_configuration_details, **kwargs) - - -# Rename oci data-science ml-app-instance create_ml_application_instance_create_idcs_custom_service_auth_configuration_details --ml-application-id --ml-application-implementation-id -# to oci data-science ml-app-instance create_ml_application_instance_create_idcs_custom_service_auth_configuration_details --ml-app-id --ml-app-implementation-id -@cli_util.copy_params_from_generated_command(datascience_cli.create_ml_application_instance_create_idcs_custom_service_auth_configuration_details, params_to_exclude=['ml_application_id', 'ml_application_implementation_id']) -@datascience_cli.ml_application_instance_group.command(name=datascience_cli.create_ml_application_instance_create_idcs_custom_service_auth_configuration_details.name, help=datascience_cli.create_ml_application_instance_create_idcs_custom_service_auth_configuration_details.help) -@cli_util.option('--ml-app-id', required=True, help=u"""The OCID of ML Application. This resource is an instance of ML Application referenced by this OCID.""") -@cli_util.option('--ml-app-implementation-id', help=u"""The OCID of ML Application Implementation selected as a certain solution for a given ML problem (ML Application)""") -@click.pass_context -def create_ml_application_instance_create_idcs_custom_service_auth_configuration_details(ctx, **kwargs): - - if isinstance(kwargs['ml_app_id'], six.string_types) and len(kwargs['ml_app_id'].strip()) == 0: - raise click.UsageError('Parameter --ml-app-id cannot be whitespace or empty string') - - if 'ml_app_id' in kwargs: - kwargs['ml_application_id'] = kwargs['ml_app_id'] - del kwargs['ml_app_id'] - if 'ml_app_implementation_id' in kwargs: - kwargs['ml_application_implementation_id'] = kwargs['ml_app_implementation_id'] - del kwargs['ml_app_implementation_id'] - - ctx.invoke(datascience_cli.create_ml_application_instance_create_idcs_custom_service_auth_configuration_details, **kwargs) - - # Rename oci data-science ml-app-instance create_ml_application_instance_create_iam_auth_configuration_create_details --ml-application-id --ml-application-implementation-id # to oci data-science ml-app-instance create_ml_application_instance_create_iam_auth_configuration_create_details --ml-app-id --ml-app-implementation-id @cli_util.copy_params_from_generated_command(datascience_cli.create_ml_application_instance_create_iam_auth_configuration_create_details, params_to_exclude=['ml_application_id', 'ml_application_implementation_id']) diff --git a/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py b/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py index 45f153152..f54b4ede8 100644 --- a/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py +++ b/services/data_science/src/oci_cli_data_science/generated/datascience_cli.py @@ -46,6 +46,12 @@ def model_group_group(): pass +@click.command(cli_util.override('data_science.compute_target_group.command_name', 'compute-target'), cls=CommandGroupWithAlias, help="""A compute target.""") +@cli_util.help_option_group +def compute_target_group(): + pass + + @click.command(cli_util.override('data_science.ml_application_instance_group.command_name', 'ml-application-instance'), cls=CommandGroupWithAlias, help="""Resource representing instance of ML Application.""") @cli_util.help_option_group def ml_application_instance_group(): @@ -148,6 +154,12 @@ def pipeline_group(): pass +@click.command(cli_util.override('data_science.compute_target_shape_group.command_name', 'compute-target-shape'), cls=CommandGroupWithAlias, help="""The compute shape used to launch a compute target.""") +@cli_util.help_option_group +def compute_target_shape_group(): + pass + + @click.command(cli_util.override('data_science.schedule_group.command_name', 'schedule'), cls=CommandGroupWithAlias, help="""A repeating action. Examples: * Invoke a ML Pipeline Run once an hour. * Call ML Job Run every night at midnight.""") @cli_util.help_option_group def schedule_group(): @@ -182,6 +194,7 @@ def data_science_private_endpoint_group(): data_science_root_group.add_command(register_model_artifact_reference_details_group) data_science_root_group.add_command(model_deployment_shape_group) data_science_root_group.add_command(model_group_group) +data_science_root_group.add_command(compute_target_group) data_science_root_group.add_command(ml_application_instance_group) data_science_root_group.add_command(ml_application_instance_view_group) data_science_root_group.add_command(project_group) @@ -199,6 +212,7 @@ def data_science_private_endpoint_group(): data_science_root_group.add_command(pipeline_run_group) data_science_root_group.add_command(ml_application_implementation_group) data_science_root_group.add_command(pipeline_group) +data_science_root_group.add_command(compute_target_shape_group) data_science_root_group.add_command(schedule_group) data_science_root_group.add_command(ml_application_group) data_science_root_group.add_command(model_version_set_group) @@ -552,6 +566,37 @@ def cancel_work_request(ctx, from_json, work_request_id, if_match): cli_util.render_response(result, ctx) +@compute_target_group.command(name=cli_util.override('data_science.change_compute_target_compartment.command_name', 'change-compartment'), help=u"""Moves a compute target into a different compartment. When provided, If-Match is checked against ETag values of the resource. \n[Command Reference](changeComputeTargetCompartment)""") +@cli_util.option('--compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where the resource should be moved.""") +@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 is updated or deleted only if the `etag` you provide matches the resource's current `etag` value.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) +@cli_util.wrap_exceptions +def change_compute_target_compartment(ctx, from_json, compute_target_id, compartment_id, if_match): + + if isinstance(compute_target_id, six.string_types) and len(compute_target_id.strip()) == 0: + raise click.UsageError('Parameter --compute-target-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('data_science', 'data_science', ctx) + result = client.change_compute_target_compartment( + compute_target_id=compute_target_id, + change_compute_target_compartment_details=_details, + **kwargs + ) + cli_util.render_response(result, ctx) + + @data_science_private_endpoint_group.command(name=cli_util.override('data_science.change_data_science_private_endpoint_compartment.command_name', 'change-compartment'), help=u"""Moves a private endpoint into a different compartment. When provided, If-Match is checked against ETag values of the resource. \n[Command Reference](changeDataSciencePrivateEndpointCompartment)""") @cli_util.option('--data-science-private-endpoint-id', required=True, help=u"""The unique ID for a Data Science private endpoint.""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create private endpoint.""") @@ -1259,6 +1304,163 @@ def change_schedule_compartment(ctx, from_json, wait_for_state, max_wait_seconds cli_util.render_response(result, ctx) +@compute_target_group.command(name=cli_util.override('data_science.create_compute_target.command_name', 'create'), help=u"""Creates a new compute target resource. \n[Command Reference](createComputeTarget)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the compute target.""") +@cli_util.option('--compute-configuration-details', required=True, 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 display name for the resource.""") +@cli_util.option('--description', help=u"""A short description of the compute target.""") +@cli_util.option('--metadata', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Metadata for the compute target. The size of metadata must be less than 2048 bytes. Key should be under 32 characters. Key should contain only letters, digits and underscore (_) Key should start with a letter. Key should have at least 2 characters. Key should not end with underscore eg. `TEST_` Key if added cannot be empty. Value can be empty. No specific size limits on individual Values. But overall metadata is limited to 2048 bytes. Key can't be reserved Compute Target metadata.""" + 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. 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. 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", "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({'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'compute-configuration-details': {'module': 'data_science', 'class': 'ComputeConfigurationDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', '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={'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'compute-configuration-details': {'module': 'data_science', 'class': 'ComputeConfigurationDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_science', 'class': 'ComputeTarget'}) +@cli_util.wrap_exceptions +def create_compute_target(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, compute_configuration_details, display_name, description, metadata, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['compartmentId'] = compartment_id + _details['computeConfigurationDetails'] = cli_util.parse_json_parameter("compute_configuration_details", compute_configuration_details) + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if metadata is not None: + _details['metadata'] = cli_util.parse_json_parameter("metadata", metadata) + + 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('data_science', 'data_science', ctx) + result = client.create_compute_target( + create_compute_target_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) + + +@compute_target_group.command(name=cli_util.override('data_science.create_compute_target_managed_compute_cluster_compute_configuration_details.command_name', 'create-compute-target-managed-compute-cluster-compute-configuration-details'), help=u"""Creates a new compute target resource. \n[Command Reference](createComputeTarget)""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the compute target.""") +@cli_util.option('--compute-configuration-details-instance-configuration', required=True, 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 display name for the resource.""") +@cli_util.option('--description', help=u"""A short description of the compute target.""") +@cli_util.option('--metadata', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Metadata for the compute target. The size of metadata must be less than 2048 bytes. Key should be under 32 characters. Key should contain only letters, digits and underscore (_) Key should start with a letter. Key should have at least 2 characters. Key should not end with underscore eg. `TEST_` Key if added cannot be empty. Value can be empty. No specific size limits on individual Values. But overall metadata is limited to 2048 bytes. Key can't be reserved Compute Target metadata.""" + 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. 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. See [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--compute-configuration-details-scaling-policy', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'compute-configuration-details-instance-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterInstanceConfigurationDetails'}, 'compute-configuration-details-scaling-policy': {'module': 'data_science', 'class': 'ManagedComputeClusterScalingPolicy'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'compute-configuration-details-instance-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterInstanceConfigurationDetails'}, 'compute-configuration-details-scaling-policy': {'module': 'data_science', 'class': 'ManagedComputeClusterScalingPolicy'}}, output_type={'module': 'data_science', 'class': 'ComputeTarget'}) +@cli_util.wrap_exceptions +def create_compute_target_managed_compute_cluster_compute_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, compute_configuration_details_instance_configuration, display_name, description, metadata, freeform_tags, defined_tags, compute_configuration_details_scaling_policy): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['computeConfigurationDetails'] = {} + _details['compartmentId'] = compartment_id + _details['computeConfigurationDetails']['instanceConfiguration'] = cli_util.parse_json_parameter("compute_configuration_details_instance_configuration", compute_configuration_details_instance_configuration) + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if metadata is not None: + _details['metadata'] = cli_util.parse_json_parameter("metadata", metadata) + + 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 compute_configuration_details_scaling_policy is not None: + _details['computeConfigurationDetails']['scalingPolicy'] = cli_util.parse_json_parameter("compute_configuration_details_scaling_policy", compute_configuration_details_scaling_policy) + + _details['computeConfigurationDetails']['computeType'] = 'MANAGED_COMPUTE_CLUSTER' + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.create_compute_target( + create_compute_target_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) + + @data_science_private_endpoint_group.command(name=cli_util.override('data_science.create_data_science_private_endpoint.command_name', 'create'), help=u"""Creates a Data Science private endpoint to be used by a Data Science resource. \n[Command Reference](createDataSciencePrivateEndpoint)""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the private endpoint.""") @cli_util.option('--subnet-id', required=True, help=u"""The OCID of the subnet.""") @@ -1925,6 +2127,102 @@ def create_job_managed_egress_standalone_job_infrastructure_configuration_detail cli_util.render_response(result, ctx) +@job_group.command(name=cli_util.override('data_science.create_job_managed_compute_cluster_job_infrastructure_configuration_details.command_name', 'create-job-managed-compute-cluster-job-infrastructure-configuration-details'), help=u"""Creates a job. \n[Command Reference](createJob)""") +@cli_util.option('--project-id', required=True, help=u"""The [OCID] of the project to associate the job with.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the job.""") +@cli_util.option('--job-infrastructure-configuration-details-compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") +@cli_util.option('--job-infrastructure-configuration-details-resource-configuration', required=True, 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 display name for the resource.""") +@cli_util.option('--description', help=u"""A short description of the job.""") +@cli_util.option('--job-configuration-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-environment-configuration-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-log-configuration-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-storage-mount-configuration-details-list', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of JobStorageMountConfigurationDetails. + +This option is a JSON list with items of type StorageMountConfigurationDetails. For documentation on StorageMountConfigurationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datascience/20190101/datatypes/StorageMountConfigurationDetails.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-node-configuration-details', 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. 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. 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(["CREATING", "ACTIVE", "DELETING", "FAILED", "DELETED"]), 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 CREATING --wait-for-state DELETED 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({'job-configuration-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-environment-configuration-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-log-configuration-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-storage-mount-configuration-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'job-node-configuration-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-details-resource-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterJobResourceConfiguration'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'job-configuration-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-environment-configuration-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-log-configuration-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-storage-mount-configuration-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'job-node-configuration-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-details-resource-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterJobResourceConfiguration'}}, output_type={'module': 'data_science', 'class': 'Job'}) +@cli_util.wrap_exceptions +def create_job_managed_compute_cluster_job_infrastructure_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, compartment_id, job_infrastructure_configuration_details_compute_target_id, job_infrastructure_configuration_details_resource_configuration, display_name, description, job_configuration_details, job_environment_configuration_details, job_log_configuration_details, job_storage_mount_configuration_details_list, job_node_configuration_details, freeform_tags, defined_tags): + + kwargs = {} + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['jobInfrastructureConfigurationDetails'] = {} + _details['projectId'] = project_id + _details['compartmentId'] = compartment_id + _details['jobInfrastructureConfigurationDetails']['computeTargetId'] = job_infrastructure_configuration_details_compute_target_id + _details['jobInfrastructureConfigurationDetails']['resourceConfiguration'] = cli_util.parse_json_parameter("job_infrastructure_configuration_details_resource_configuration", job_infrastructure_configuration_details_resource_configuration) + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if job_configuration_details is not None: + _details['jobConfigurationDetails'] = cli_util.parse_json_parameter("job_configuration_details", job_configuration_details) + + if job_environment_configuration_details is not None: + _details['jobEnvironmentConfigurationDetails'] = cli_util.parse_json_parameter("job_environment_configuration_details", job_environment_configuration_details) + + if job_log_configuration_details is not None: + _details['jobLogConfigurationDetails'] = cli_util.parse_json_parameter("job_log_configuration_details", job_log_configuration_details) + + if job_storage_mount_configuration_details_list is not None: + _details['jobStorageMountConfigurationDetailsList'] = cli_util.parse_json_parameter("job_storage_mount_configuration_details_list", job_storage_mount_configuration_details_list) + + if job_node_configuration_details is not None: + _details['jobNodeConfigurationDetails'] = cli_util.parse_json_parameter("job_node_configuration_details", job_node_configuration_details) + + 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) + + _details['jobInfrastructureConfigurationDetails']['jobInfrastructureType'] = 'MANAGED_COMPUTE_CLUSTER' + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.create_job( + create_job_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_job') and callable(getattr(client, 'get_job')): + 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_job(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) + + @job_group.command(name=cli_util.override('data_science.create_job_standalone_job_infrastructure_configuration_details.command_name', 'create-job-standalone-job-infrastructure-configuration-details'), help=u"""Creates a job. \n[Command Reference](createJob)""") @cli_util.option('--project-id', required=True, help=u"""The [OCID] of the project to associate the job with.""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the job.""") @@ -2983,13 +3281,12 @@ def create_job_run_managed_egress_standalone_job_infrastructure_configuration_de cli_util.render_response(result, ctx) -@job_run_group.command(name=cli_util.override('data_science.create_job_run_standalone_job_infrastructure_configuration_details.command_name', 'create-job-run-standalone-job-infrastructure-configuration-details'), help=u"""Creates a job run. \n[Command Reference](createJobRun)""") +@job_run_group.command(name=cli_util.override('data_science.create_job_run_managed_compute_cluster_job_infrastructure_configuration_details.command_name', 'create-job-run-managed-compute-cluster-job-infrastructure-configuration-details'), help=u"""Creates a job run. \n[Command Reference](createJobRun)""") @cli_util.option('--project-id', required=True, help=u"""The [OCID] of the project to associate the job run with.""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the job run.""") @cli_util.option('--job-id', required=True, help=u"""The [OCID] of the job to create a run for.""") -@cli_util.option('--job-infrastructure-configuration-override-details-shape-name', required=True, help=u"""The shape used to launch the job run instances.""") -@cli_util.option('--job-infrastructure-configuration-override-details-subnet-id', required=True, help=u"""The subnet to create a secondary vnic in to attach to the instance running the job""") -@cli_util.option('--job-infrastructure-configuration-override-details-block-storage-size-in-gbs', required=True, type=click.INT, help=u"""The size of the block storage volume to attach to the instance running the job""") +@cli_util.option('--job-infrastructure-configuration-override-details-compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") +@cli_util.option('--job-infrastructure-configuration-override-details-resource-configuration', required=True, 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 display name for the resource.""") @cli_util.option('--job-configuration-override-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--job-log-configuration-override-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @@ -3001,16 +3298,15 @@ def create_job_run_managed_egress_standalone_job_infrastructure_configuration_de @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. 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. See [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--opc-parent-rpt-url', help=u"""URL to fetch the Resource Principal Token from the parent resource.""") -@cli_util.option('--job-infrastructure-configuration-override-details-job-shape-config-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "DELETED", "NEEDS_ATTENTION"]), 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 ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") @cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the 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({'job-configuration-override-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-log-configuration-override-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-environment-configuration-override-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-node-configuration-override-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'job-storage-mount-configuration-override-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-override-details-job-shape-config-details': {'module': 'data_science', 'class': 'JobShapeConfigDetails'}}) +@json_skeleton_utils.get_cli_json_input_option({'job-configuration-override-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-log-configuration-override-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-environment-configuration-override-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-node-configuration-override-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'job-storage-mount-configuration-override-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-override-details-resource-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterJobResourceConfiguration'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'job-configuration-override-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-log-configuration-override-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-environment-configuration-override-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-node-configuration-override-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'job-storage-mount-configuration-override-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-override-details-job-shape-config-details': {'module': 'data_science', 'class': 'JobShapeConfigDetails'}}, output_type={'module': 'data_science', 'class': 'JobRun'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'job-configuration-override-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-log-configuration-override-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-environment-configuration-override-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-node-configuration-override-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'job-storage-mount-configuration-override-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-override-details-resource-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterJobResourceConfiguration'}}, output_type={'module': 'data_science', 'class': 'JobRun'}) @cli_util.wrap_exceptions -def create_job_run_standalone_job_infrastructure_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, compartment_id, job_id, job_infrastructure_configuration_override_details_shape_name, job_infrastructure_configuration_override_details_subnet_id, job_infrastructure_configuration_override_details_block_storage_size_in_gbs, display_name, job_configuration_override_details, job_log_configuration_override_details, job_environment_configuration_override_details, job_node_configuration_override_details, job_storage_mount_configuration_override_details_list, freeform_tags, defined_tags, opc_parent_rpt_url, job_infrastructure_configuration_override_details_job_shape_config_details): +def create_job_run_managed_compute_cluster_job_infrastructure_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, compartment_id, job_id, job_infrastructure_configuration_override_details_compute_target_id, job_infrastructure_configuration_override_details_resource_configuration, display_name, job_configuration_override_details, job_log_configuration_override_details, job_environment_configuration_override_details, job_node_configuration_override_details, job_storage_mount_configuration_override_details_list, freeform_tags, defined_tags, opc_parent_rpt_url): kwargs = {} if opc_parent_rpt_url is not None: @@ -3022,9 +3318,8 @@ def create_job_run_standalone_job_infrastructure_configuration_details(ctx, from _details['projectId'] = project_id _details['compartmentId'] = compartment_id _details['jobId'] = job_id - _details['jobInfrastructureConfigurationOverrideDetails']['shapeName'] = job_infrastructure_configuration_override_details_shape_name - _details['jobInfrastructureConfigurationOverrideDetails']['subnetId'] = job_infrastructure_configuration_override_details_subnet_id - _details['jobInfrastructureConfigurationOverrideDetails']['blockStorageSizeInGBs'] = job_infrastructure_configuration_override_details_block_storage_size_in_gbs + _details['jobInfrastructureConfigurationOverrideDetails']['computeTargetId'] = job_infrastructure_configuration_override_details_compute_target_id + _details['jobInfrastructureConfigurationOverrideDetails']['resourceConfiguration'] = cli_util.parse_json_parameter("job_infrastructure_configuration_override_details_resource_configuration", job_infrastructure_configuration_override_details_resource_configuration) if display_name is not None: _details['displayName'] = display_name @@ -3050,7 +3345,107 @@ def create_job_run_standalone_job_infrastructure_configuration_details(ctx, from if defined_tags is not None: _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) - if job_infrastructure_configuration_override_details_job_shape_config_details is not None: + _details['jobInfrastructureConfigurationOverrideDetails']['jobInfrastructureType'] = 'MANAGED_COMPUTE_CLUSTER' + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.create_job_run( + create_job_run_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_job_run') and callable(getattr(client, 'get_job_run')): + 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_job_run(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) + + +@job_run_group.command(name=cli_util.override('data_science.create_job_run_standalone_job_infrastructure_configuration_details.command_name', 'create-job-run-standalone-job-infrastructure-configuration-details'), help=u"""Creates a job run. \n[Command Reference](createJobRun)""") +@cli_util.option('--project-id', required=True, help=u"""The [OCID] of the project to associate the job run with.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the job run.""") +@cli_util.option('--job-id', required=True, help=u"""The [OCID] of the job to create a run for.""") +@cli_util.option('--job-infrastructure-configuration-override-details-shape-name', required=True, help=u"""The shape used to launch the job run instances.""") +@cli_util.option('--job-infrastructure-configuration-override-details-subnet-id', required=True, help=u"""The subnet to create a secondary vnic in to attach to the instance running the job""") +@cli_util.option('--job-infrastructure-configuration-override-details-block-storage-size-in-gbs', required=True, type=click.INT, help=u"""The size of the block storage volume to attach to the instance running the job""") +@cli_util.option('--display-name', help=u"""A user-friendly display name for the resource.""") +@cli_util.option('--job-configuration-override-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-log-configuration-override-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-environment-configuration-override-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-node-configuration-override-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--job-storage-mount-configuration-override-details-list', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of JobStorageMountConfigurationDetails. + +This option is a JSON list with items of type StorageMountConfigurationDetails. For documentation on StorageMountConfigurationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datascience/20190101/datatypes/StorageMountConfigurationDetails.""" + 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. 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. See [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--opc-parent-rpt-url', help=u"""URL to fetch the Resource Principal Token from the parent resource.""") +@cli_util.option('--job-infrastructure-configuration-override-details-job-shape-config-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "DELETED", "NEEDS_ATTENTION"]), 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 ACCEPTED --wait-for-state NEEDS_ATTENTION would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""") +@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the 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({'job-configuration-override-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-log-configuration-override-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-environment-configuration-override-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-node-configuration-override-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'job-storage-mount-configuration-override-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-override-details-job-shape-config-details': {'module': 'data_science', 'class': 'JobShapeConfigDetails'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'job-configuration-override-details': {'module': 'data_science', 'class': 'JobConfigurationDetails'}, 'job-log-configuration-override-details': {'module': 'data_science', 'class': 'JobLogConfigurationDetails'}, 'job-environment-configuration-override-details': {'module': 'data_science', 'class': 'JobEnvironmentConfigurationDetails'}, 'job-node-configuration-override-details': {'module': 'data_science', 'class': 'JobNodeConfigurationDetails'}, 'job-storage-mount-configuration-override-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-override-details-job-shape-config-details': {'module': 'data_science', 'class': 'JobShapeConfigDetails'}}, output_type={'module': 'data_science', 'class': 'JobRun'}) +@cli_util.wrap_exceptions +def create_job_run_standalone_job_infrastructure_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, compartment_id, job_id, job_infrastructure_configuration_override_details_shape_name, job_infrastructure_configuration_override_details_subnet_id, job_infrastructure_configuration_override_details_block_storage_size_in_gbs, display_name, job_configuration_override_details, job_log_configuration_override_details, job_environment_configuration_override_details, job_node_configuration_override_details, job_storage_mount_configuration_override_details_list, freeform_tags, defined_tags, opc_parent_rpt_url, job_infrastructure_configuration_override_details_job_shape_config_details): + + kwargs = {} + if opc_parent_rpt_url is not None: + kwargs['opc_parent_rpt_url'] = opc_parent_rpt_url + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['jobInfrastructureConfigurationOverrideDetails'] = {} + _details['projectId'] = project_id + _details['compartmentId'] = compartment_id + _details['jobId'] = job_id + _details['jobInfrastructureConfigurationOverrideDetails']['shapeName'] = job_infrastructure_configuration_override_details_shape_name + _details['jobInfrastructureConfigurationOverrideDetails']['subnetId'] = job_infrastructure_configuration_override_details_subnet_id + _details['jobInfrastructureConfigurationOverrideDetails']['blockStorageSizeInGBs'] = job_infrastructure_configuration_override_details_block_storage_size_in_gbs + + if display_name is not None: + _details['displayName'] = display_name + + if job_configuration_override_details is not None: + _details['jobConfigurationOverrideDetails'] = cli_util.parse_json_parameter("job_configuration_override_details", job_configuration_override_details) + + if job_log_configuration_override_details is not None: + _details['jobLogConfigurationOverrideDetails'] = cli_util.parse_json_parameter("job_log_configuration_override_details", job_log_configuration_override_details) + + if job_environment_configuration_override_details is not None: + _details['jobEnvironmentConfigurationOverrideDetails'] = cli_util.parse_json_parameter("job_environment_configuration_override_details", job_environment_configuration_override_details) + + if job_node_configuration_override_details is not None: + _details['jobNodeConfigurationOverrideDetails'] = cli_util.parse_json_parameter("job_node_configuration_override_details", job_node_configuration_override_details) + + if job_storage_mount_configuration_override_details_list is not None: + _details['jobStorageMountConfigurationOverrideDetailsList'] = cli_util.parse_json_parameter("job_storage_mount_configuration_override_details_list", job_storage_mount_configuration_override_details_list) + + 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 job_infrastructure_configuration_override_details_job_shape_config_details is not None: _details['jobInfrastructureConfigurationOverrideDetails']['jobShapeConfigDetails'] = cli_util.parse_json_parameter("job_infrastructure_configuration_override_details_job_shape_config_details", job_infrastructure_configuration_override_details_job_shape_config_details) _details['jobInfrastructureConfigurationOverrideDetails']['jobInfrastructureType'] = 'STANDALONE' @@ -3412,184 +3807,6 @@ def create_ml_application_instance(ctx, from_json, wait_for_state, max_wait_seco cli_util.render_response(result, ctx) -@ml_application_instance_group.command(name=cli_util.override('data_science.create_ml_application_instance_create_idcs_auth_configuration_details.command_name', 'create-ml-application-instance-create-idcs-auth-configuration-details'), help=u"""Creates a new MlApplicationInstance. \n[Command Reference](createMlApplicationInstance)""") -@cli_util.option('--ml-application-id', required=True, help=u"""The OCID of ML Application. This resource is an instance of ML Application referenced by this OCID.""") -@cli_util.option('--ml-application-implementation-id', required=True, help=u"""The OCID of ML Application Implementation selected as a certain solution for a given ML problem (ML Application)""") -@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the MlApplicationInstance is created.""") -@cli_util.option('--auth-configuration-domain-id', required=True, help=u"""Identity Domain OCID""") -@cli_util.option('--display-name', help=u"""The name of MlApplicationInstance. System will generate displayName when not provided.""") -@cli_util.option('--configuration', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Data that are used for provisioning of the given MlApplicationInstance. These are validated against configurationSchema defined in referenced MlApplicationImplementation. - -This option is a JSON list with items of type ConfigurationProperty. For documentation on ConfigurationProperty please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datascience/20190101/datatypes/ConfigurationProperty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-enabled', type=click.BOOL, help=u"""Defines whether the MlApplicationInstance will be created in ACTIVE (true value) or INACTIVE (false value) lifecycle state.""") -@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. 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. 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", "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({'configuration': {'module': 'data_science', 'class': 'list[ConfigurationProperty]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', '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={'configuration': {'module': 'data_science', 'class': 'list[ConfigurationProperty]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_science', 'class': 'MlApplicationInstance'}) -@cli_util.wrap_exceptions -def create_ml_application_instance_create_idcs_auth_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, ml_application_id, ml_application_implementation_id, compartment_id, auth_configuration_domain_id, display_name, configuration, is_enabled, freeform_tags, defined_tags): - - kwargs = {} - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['authConfiguration'] = {} - _details['mlApplicationId'] = ml_application_id - _details['mlApplicationImplementationId'] = ml_application_implementation_id - _details['compartmentId'] = compartment_id - _details['authConfiguration']['domainId'] = auth_configuration_domain_id - - if display_name is not None: - _details['displayName'] = display_name - - if configuration is not None: - _details['configuration'] = cli_util.parse_json_parameter("configuration", configuration) - - if is_enabled is not None: - _details['isEnabled'] = is_enabled - - 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) - - _details['authConfiguration']['type'] = 'IDCS' - - client = cli_util.build_client('data_science', 'data_science', ctx) - result = client.create_ml_application_instance( - create_ml_application_instance_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): - try: - wait_period_kwargs = {} - if max_wait_seconds is not None: - wait_period_kwargs['max_wait_seconds'] = max_wait_seconds - if wait_interval_seconds is not None: - wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds - if 'opc-work-request-id' not in result.headers: - click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') - cli_util.render_response(result, ctx) - return - - click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) - result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) - except oci.exceptions.MaximumWaitTimeExceeded as e: - # If we fail, we should show an error, but we should still provide the information to the customer - click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) - cli_util.render_response(result, ctx) - sys.exit(2) - except Exception: - click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) - cli_util.render_response(result, ctx) - raise - else: - click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) - cli_util.render_response(result, ctx) - - -@ml_application_instance_group.command(name=cli_util.override('data_science.create_ml_application_instance_create_idcs_custom_service_auth_configuration_details.command_name', 'create-ml-application-instance-create-idcs-custom-service-auth-configuration-details'), help=u"""Creates a new MlApplicationInstance. \n[Command Reference](createMlApplicationInstance)""") -@cli_util.option('--ml-application-id', required=True, help=u"""The OCID of ML Application. This resource is an instance of ML Application referenced by this OCID.""") -@cli_util.option('--ml-application-implementation-id', required=True, help=u"""The OCID of ML Application Implementation selected as a certain solution for a given ML problem (ML Application)""") -@cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment where the MlApplicationInstance is created.""") -@cli_util.option('--auth-configuration-audience', required=True, help=u"""Audience of the IDCS application""") -@cli_util.option('--auth-configuration-scope', required=True, help=u"""Scope of the IDCS application""") -@cli_util.option('--auth-configuration-application-name', required=True, help=u"""Name of the IDCS application""") -@cli_util.option('--auth-configuration-access-token', required=True, help=u"""Bearer token serving as Proof-of-Ownership for referenced IDCS stripe/application""") -@cli_util.option('--display-name', help=u"""The name of MlApplicationInstance. System will generate displayName when not provided.""") -@cli_util.option('--configuration', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Data that are used for provisioning of the given MlApplicationInstance. These are validated against configurationSchema defined in referenced MlApplicationImplementation. - -This option is a JSON list with items of type ConfigurationProperty. For documentation on ConfigurationProperty please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datascience/20190101/datatypes/ConfigurationProperty.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-enabled', type=click.BOOL, help=u"""Defines whether the MlApplicationInstance will be created in ACTIVE (true value) or INACTIVE (false value) lifecycle state.""") -@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. 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. See [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--auth-configuration-role-name', help=u"""Name of the IDCS application role""") -@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'configuration': {'module': 'data_science', 'class': 'list[ConfigurationProperty]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', '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={'configuration': {'module': 'data_science', 'class': 'list[ConfigurationProperty]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'data_science', 'class': 'MlApplicationInstance'}) -@cli_util.wrap_exceptions -def create_ml_application_instance_create_idcs_custom_service_auth_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, ml_application_id, ml_application_implementation_id, compartment_id, auth_configuration_audience, auth_configuration_scope, auth_configuration_application_name, auth_configuration_access_token, display_name, configuration, is_enabled, freeform_tags, defined_tags, auth_configuration_role_name): - - kwargs = {} - kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) - - _details = {} - _details['authConfiguration'] = {} - _details['mlApplicationId'] = ml_application_id - _details['mlApplicationImplementationId'] = ml_application_implementation_id - _details['compartmentId'] = compartment_id - _details['authConfiguration']['audience'] = auth_configuration_audience - _details['authConfiguration']['scope'] = auth_configuration_scope - _details['authConfiguration']['applicationName'] = auth_configuration_application_name - _details['authConfiguration']['accessToken'] = auth_configuration_access_token - - if display_name is not None: - _details['displayName'] = display_name - - if configuration is not None: - _details['configuration'] = cli_util.parse_json_parameter("configuration", configuration) - - if is_enabled is not None: - _details['isEnabled'] = is_enabled - - 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 auth_configuration_role_name is not None: - _details['authConfiguration']['roleName'] = auth_configuration_role_name - - _details['authConfiguration']['type'] = 'IDCS_CUSTOM_SERVICE' - - client = cli_util.build_client('data_science', 'data_science', ctx) - result = client.create_ml_application_instance( - create_ml_application_instance_details=_details, - **kwargs - ) - if wait_for_state: - - if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')): - try: - wait_period_kwargs = {} - if max_wait_seconds is not None: - wait_period_kwargs['max_wait_seconds'] = max_wait_seconds - if wait_interval_seconds is not None: - wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds - if 'opc-work-request-id' not in result.headers: - click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state') - cli_util.render_response(result, ctx) - return - - click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr) - result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs) - except oci.exceptions.MaximumWaitTimeExceeded as e: - # If we fail, we should show an error, but we should still provide the information to the customer - click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr) - cli_util.render_response(result, ctx) - sys.exit(2) - except Exception: - click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr) - cli_util.render_response(result, ctx) - raise - else: - click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr) - cli_util.render_response(result, ctx) - - @ml_application_instance_group.command(name=cli_util.override('data_science.create_ml_application_instance_create_iam_auth_configuration_create_details.command_name', 'create-ml-application-instance-create-iam-auth-configuration-create-details'), help=u"""Creates a new MlApplicationInstance. \n[Command Reference](createMlApplicationInstance)""") @cli_util.option('--ml-application-id', required=True, help=u"""The OCID of ML Application. This resource is an instance of ML Application referenced by this OCID.""") @cli_util.option('--ml-application-implementation-id', required=True, help=u"""The OCID of ML Application Implementation selected as a certain solution for a given ML problem (ML Application)""") @@ -4152,6 +4369,95 @@ def create_model_deployment_model_group_deployment_configuration_details(ctx, fr cli_util.render_response(result, ctx) +@model_deployment_group.command(name=cli_util.override('data_science.create_model_deployment_single_model_deployment_flex_configuration_details.command_name', 'create-model-deployment-single-model-deployment-flex-configuration-details'), help=u"""Creates a new model deployment. \n[Command Reference](createModelDeployment)""") +@cli_util.option('--project-id', required=True, help=u"""The [OCID] of the project to associate with the model deployment.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment where you want to create the model deployment.""") +@cli_util.option('--model-deployment-configuration-details-model-configuration-details', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--model-deployment-configuration-details-infrastructure-configuration-details', required=True, 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 display name for the resource. Does not have to be unique, and can be modified. Avoid entering confidential information. Example: `My ModelDeployment`""") +@cli_util.option('--description', help=u"""A short description of the model deployment.""") +@cli_util.option('--category-log-details', 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. 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. See [Resource Tags]. Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--opc-parent-rpt-url', help=u"""URL to fetch the Resource Principal Token from the parent resource.""") +@cli_util.option('--model-deployment-configuration-details-environment-configuration-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'category-log-details': {'module': 'data_science', 'class': 'CategoryLogDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'model-deployment-configuration-details-model-configuration-details': {'module': 'data_science', 'class': 'SingleModelConfigurationDetails'}, 'model-deployment-configuration-details-infrastructure-configuration-details': {'module': 'data_science', 'class': 'ModelDeployInfrastructureConfigurationDetails'}, 'model-deployment-configuration-details-environment-configuration-details': {'module': 'data_science', 'class': 'ModelDeploymentEnvironmentConfigurationDetails'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'category-log-details': {'module': 'data_science', 'class': 'CategoryLogDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'model-deployment-configuration-details-model-configuration-details': {'module': 'data_science', 'class': 'SingleModelConfigurationDetails'}, 'model-deployment-configuration-details-infrastructure-configuration-details': {'module': 'data_science', 'class': 'ModelDeployInfrastructureConfigurationDetails'}, 'model-deployment-configuration-details-environment-configuration-details': {'module': 'data_science', 'class': 'ModelDeploymentEnvironmentConfigurationDetails'}}, output_type={'module': 'data_science', 'class': 'ModelDeployment'}) +@cli_util.wrap_exceptions +def create_model_deployment_single_model_deployment_flex_configuration_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, project_id, compartment_id, model_deployment_configuration_details_model_configuration_details, model_deployment_configuration_details_infrastructure_configuration_details, display_name, description, category_log_details, freeform_tags, defined_tags, opc_parent_rpt_url, model_deployment_configuration_details_environment_configuration_details): + + kwargs = {} + if opc_parent_rpt_url is not None: + kwargs['opc_parent_rpt_url'] = opc_parent_rpt_url + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['modelDeploymentConfigurationDetails'] = {} + _details['projectId'] = project_id + _details['compartmentId'] = compartment_id + _details['modelDeploymentConfigurationDetails']['modelConfigurationDetails'] = cli_util.parse_json_parameter("model_deployment_configuration_details_model_configuration_details", model_deployment_configuration_details_model_configuration_details) + _details['modelDeploymentConfigurationDetails']['infrastructureConfigurationDetails'] = cli_util.parse_json_parameter("model_deployment_configuration_details_infrastructure_configuration_details", model_deployment_configuration_details_infrastructure_configuration_details) + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if category_log_details is not None: + _details['categoryLogDetails'] = cli_util.parse_json_parameter("category_log_details", category_log_details) + + 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 model_deployment_configuration_details_environment_configuration_details is not None: + _details['modelDeploymentConfigurationDetails']['environmentConfigurationDetails'] = cli_util.parse_json_parameter("model_deployment_configuration_details_environment_configuration_details", model_deployment_configuration_details_environment_configuration_details) + + _details['modelDeploymentConfigurationDetails']['deploymentType'] = 'SINGLE_MODEL_FLEX' + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.create_model_deployment( + create_model_deployment_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) + + @model_group_group.command(name=cli_util.override('data_science.create_model_group.command_name', 'create'), help=u"""Create a new Model Group resource. \n[Command Reference](createModelGroup)""") @cli_util.option('--create-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["CREATE", "CLONE"]), help=u"""The type of the model group create operation.""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment to create the modelGroup in.""") @@ -5778,8 +6084,63 @@ def deactivate_notebook_session(ctx, from_json, wait_for_state, max_wait_seconds 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('data_science', 'data_science', ctx) - result = client.deactivate_notebook_session( - notebook_session_id=notebook_session_id, + result = client.deactivate_notebook_session( + notebook_session_id=notebook_session_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) + + +@schedule_group.command(name=cli_util.override('data_science.deactivate_schedule.command_name', 'deactivate'), help=u"""Deactivate schedule. \n[Command Reference](deactivateSchedule)""") +@cli_util.option('--schedule-id', required=True, help=u"""unique Schedule identifier""") +@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource is 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", "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 deactivate_schedule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, schedule_id, if_match): + + if isinstance(schedule_id, six.string_types) and len(schedule_id.strip()) == 0: + raise click.UsageError('Parameter --schedule-id cannot be whitespace or empty string') + + 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('data_science', 'data_science', ctx) + result = client.deactivate_schedule( + schedule_id=schedule_id, **kwargs ) if wait_for_state: @@ -5812,9 +6173,10 @@ def deactivate_notebook_session(ctx, from_json, wait_for_state, max_wait_seconds cli_util.render_response(result, ctx) -@schedule_group.command(name=cli_util.override('data_science.deactivate_schedule.command_name', 'deactivate'), help=u"""Deactivate schedule. \n[Command Reference](deactivateSchedule)""") -@cli_util.option('--schedule-id', required=True, help=u"""unique Schedule identifier""") +@compute_target_group.command(name=cli_util.override('data_science.delete_compute_target.command_name', 'delete'), help=u"""Deletes the specified compute target. \n[Command Reference](deleteComputeTarget)""") +@cli_util.option('--compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") @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 is 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", "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.""") @@ -5823,18 +6185,18 @@ def deactivate_notebook_session(ctx, from_json, wait_for_state, max_wait_seconds @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) @cli_util.wrap_exceptions -def deactivate_schedule(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, schedule_id, if_match): +def delete_compute_target(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compute_target_id, if_match): - if isinstance(schedule_id, six.string_types) and len(schedule_id.strip()) == 0: - raise click.UsageError('Parameter --schedule-id cannot be whitespace or empty string') + if isinstance(compute_target_id, six.string_types) and len(compute_target_id.strip()) == 0: + raise click.UsageError('Parameter --compute-target-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('data_science', 'data_science', ctx) - result = client.deactivate_schedule( - schedule_id=schedule_id, + result = client.delete_compute_target( + compute_target_id=compute_target_id, **kwargs ) if wait_for_state: @@ -5855,7 +6217,7 @@ def deactivate_schedule(ctx, from_json, wait_for_state, max_wait_seconds, wait_i 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) + 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: @@ -7125,6 +7487,28 @@ def export_model_artifact_artifact_export_details_object_storage(ctx, from_json, cli_util.render_response(result, ctx) +@compute_target_group.command(name=cli_util.override('data_science.get_compute_target.command_name', 'get'), help=u"""Retrieves the compute target for the specified `computeTargetId`. \n[Command Reference](getComputeTarget)""") +@cli_util.option('--compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") +@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': 'data_science', 'class': 'ComputeTarget'}) +@cli_util.wrap_exceptions +def get_compute_target(ctx, from_json, compute_target_id): + + if isinstance(compute_target_id, six.string_types) and len(compute_target_id.strip()) == 0: + raise click.UsageError('Parameter --compute-target-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('data_science', 'data_science', ctx) + result = client.get_compute_target( + compute_target_id=compute_target_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @data_science_private_endpoint_group.command(name=cli_util.override('data_science.get_data_science_private_endpoint.command_name', 'get'), help=u"""Retrieves an private endpoint using a `privateEndpointId`. \n[Command Reference](getDataSciencePrivateEndpoint)""") @cli_util.option('--data-science-private-endpoint-id', required=True, help=u"""The unique ID for a Data Science private endpoint.""") @json_skeleton_utils.get_cli_json_input_option({}) @@ -8244,6 +8628,125 @@ def import_model_artifact_artifact_import_details_object_storage(ctx, from_json, cli_util.render_response(result, ctx) +@compute_target_shape_group.command(name=cli_util.override('data_science.list_compute_target_shapes.command_name', 'list'), help=u"""Lists the valid compute target shapes. \n[Command Reference](listComputeTargetShapes)""") +@cli_util.option('--compartment-id', required=True, help=u"""Filter results by the [OCID] of the compartment.""") +@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. 1 is the minimum, 100 is the maximum. See [List Pagination]. + +Example: `50`""") +@cli_util.option('--page', help=u"""For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call. + +See [List Pagination].""") +@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': 'data_science', 'class': 'list[ComputeTargetShapeSummary]'}) +@cli_util.wrap_exceptions +def list_compute_target_shapes(ctx, from_json, all_pages, page_size, compartment_id, limit, page): + + if all_pages and limit: + raise click.UsageError('If you provide the --all option you cannot provide the --limit option') + + 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('data_science', 'data_science', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_compute_target_shapes, + compartment_id=compartment_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_compute_target_shapes, + limit, + page_size, + compartment_id=compartment_id, + **kwargs + ) + else: + result = client.list_compute_target_shapes( + compartment_id=compartment_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + +@compute_target_group.command(name=cli_util.override('data_science.list_compute_targets.command_name', 'list'), help=u"""List all compute targets in the specified compartment. Supports queries on various other parameters in the query alongside compartmentId (must be included). \n[Command Reference](listComputeTargets)""") +@cli_util.option('--compartment-id', required=True, help=u"""Filter results by the [OCID] of the compartment.""") +@cli_util.option('--id', help=u"""Filter results by [OCID]. Must be an OCID of the correct type for the resource type.""") +@cli_util.option('--display-name', help=u"""Filter results by its user-friendly name.""") +@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "DELETING", "DELETED", "FAILED", "UPDATING", "NEEDS_ATTENTION"]), help=u"""Filter results by the specified lifecycle state. Must be a valid state for the resource type.""") +@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. 1 is the minimum, 100 is the maximum. See [List Pagination]. + +Example: `50`""") +@cli_util.option('--page', help=u"""For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call. + +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"""Specifies the field to sort by. Accepts only one field. By default, when you sort by `timeCreated`, the results are shown in descending order. When you sort by `displayName`, the results are shown in ascending order. Sort order for the `displayName` field is case sensitive.""") +@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""") +@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""") +@json_skeleton_utils.get_cli_json_input_option({}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'data_science', 'class': 'list[ComputeTargetSummary]'}) +@cli_util.wrap_exceptions +def list_compute_targets(ctx, from_json, all_pages, page_size, compartment_id, 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 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('data_science', 'data_science', ctx) + if all_pages: + if page_size: + kwargs['limit'] = page_size + + result = cli_util.list_call_get_all_results( + client.list_compute_targets, + compartment_id=compartment_id, + **kwargs + ) + elif limit is not None: + result = cli_util.list_call_get_up_to_limit( + client.list_compute_targets, + limit, + page_size, + compartment_id=compartment_id, + **kwargs + ) + else: + result = client.list_compute_targets( + compartment_id=compartment_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @container_group.command(name=cli_util.override('data_science.list_containers.command_name', 'list'), help=u"""List containers. \n[Command Reference](listContainers)""") @cli_util.option('--is-latest', type=click.BOOL, help=u"""if true, this returns latest version of container.""") @cli_util.option('--display-name', help=u"""Filter results by its user-friendly name.""") @@ -10088,7 +10591,7 @@ def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id @cli_util.option('--compartment-id', required=True, help=u"""Filter results by the [OCID] of the compartment.""") @cli_util.option('--id', help=u"""Filter results by [OCID]. Must be an OCID of the correct type for the resource type.""") @cli_util.option('--resource-id', help=u"""Filter results by the [OCID] of the resource associated with the work request.""") -@cli_util.option('--operation-type', type=custom_types.CliCaseInsensitiveChoice(["NOTEBOOK_SESSION_CREATE", "NOTEBOOK_SESSION_DELETE", "NOTEBOOK_SESSION_ACTIVATE", "NOTEBOOK_SESSION_DEACTIVATE", "MODELVERSIONSET_DELETE", "EXPORT_MODEL_ARTIFACT", "IMPORT_MODEL_ARTIFACT", "MODEL_DEPLOYMENT_CREATE", "MODEL_DEPLOYMENT_DELETE", "MODEL_DEPLOYMENT_ACTIVATE", "MODEL_DEPLOYMENT_DEACTIVATE", "MODEL_DEPLOYMENT_UPDATE", "PROJECT_DELETE", "WORKREQUEST_CANCEL", "JOB_DELETE", "PIPELINE_CREATE", "PIPELINE_DELETE", "PIPELINE_RUN_CREATE", "PIPELINE_RUN_CANCEL", "PIPELINE_RUN_DELETE", "ML_APPLICATION_PACKAGE_UPLOAD", "ML_APPLICATION_TRIGGER_START", "ML_APPLICATION_IMPLEMENTATION_DELETE", "ML_APPLICATION_IMPLEMENTATION_UPDATE", "ML_APPLICATION_IMPLEMENTATION_MOVE", "ML_APPLICATION_INSTANCE_CREATE", "ML_APPLICATION_INSTANCE_UPDATE", "ML_APPLICATION_INSTANCE_DELETE", "ML_APPLICATION_INSTANCE_MOVE", "ML_APPLICATION_INSTANCE_VIEW_CREATE", "ML_APPLICATION_INSTANCE_VIEW_UPDATE", "ML_APPLICATION_INSTANCE_VIEW_DELETE", "ML_APPLICATION_INSTANCE_VIEW_UPGRADE", "ML_APPLICATION_INSTANCE_VIEW_MOVE", "PRIVATE_ENDPOINT_CREATE", "PRIVATE_ENDPOINT_DELETE", "PRIVATE_ENDPOINT_MOVE", "PRIVATE_ENDPOINT_UPDATE", "SCHEDULE_CREATE", "SCHEDULE_UPDATE", "SCHEDULE_DELETE", "SCHEDULE_MOVE", "SCHEDULE_ACTIVATE", "SCHEDULE_DEACTIVATE", "REGISTER_MODEL_ARTIFACT", "RESTORE_ARCHIVED_MODEL", "MODEL_GROUP_CREATE", "MODEL_GROUP_UPDATE", "MODEL_GROUP_DELETE", "MODEL_GROUP_VERSION_HISTORY_DELETE"]), help=u"""Filter results by the type of the operation associated with the work request.""") +@cli_util.option('--operation-type', type=custom_types.CliCaseInsensitiveChoice(["NOTEBOOK_SESSION_CREATE", "NOTEBOOK_SESSION_DELETE", "NOTEBOOK_SESSION_ACTIVATE", "NOTEBOOK_SESSION_DEACTIVATE", "MODELVERSIONSET_DELETE", "EXPORT_MODEL_ARTIFACT", "IMPORT_MODEL_ARTIFACT", "MODEL_DEPLOYMENT_CREATE", "MODEL_DEPLOYMENT_DELETE", "MODEL_DEPLOYMENT_ACTIVATE", "MODEL_DEPLOYMENT_DEACTIVATE", "MODEL_DEPLOYMENT_UPDATE", "PROJECT_DELETE", "WORKREQUEST_CANCEL", "JOB_DELETE", "PIPELINE_CREATE", "PIPELINE_DELETE", "PIPELINE_RUN_CREATE", "PIPELINE_RUN_CANCEL", "PIPELINE_RUN_DELETE", "ML_APPLICATION_PACKAGE_UPLOAD", "ML_APPLICATION_TRIGGER_START", "ML_APPLICATION_IMPLEMENTATION_DELETE", "ML_APPLICATION_IMPLEMENTATION_UPDATE", "ML_APPLICATION_IMPLEMENTATION_MOVE", "ML_APPLICATION_INSTANCE_CREATE", "ML_APPLICATION_INSTANCE_UPDATE", "ML_APPLICATION_INSTANCE_DELETE", "ML_APPLICATION_INSTANCE_MOVE", "ML_APPLICATION_INSTANCE_VIEW_CREATE", "ML_APPLICATION_INSTANCE_VIEW_UPDATE", "ML_APPLICATION_INSTANCE_VIEW_DELETE", "ML_APPLICATION_INSTANCE_VIEW_UPGRADE", "ML_APPLICATION_INSTANCE_VIEW_MOVE", "PRIVATE_ENDPOINT_CREATE", "PRIVATE_ENDPOINT_DELETE", "PRIVATE_ENDPOINT_MOVE", "PRIVATE_ENDPOINT_UPDATE", "SCHEDULE_CREATE", "SCHEDULE_UPDATE", "SCHEDULE_DELETE", "SCHEDULE_MOVE", "SCHEDULE_ACTIVATE", "SCHEDULE_DEACTIVATE", "REGISTER_MODEL_ARTIFACT", "RESTORE_ARCHIVED_MODEL", "COMPUTE_TARGET_CREATE", "COMPUTE_TARGET_UPDATE", "COMPUTE_TARGET_DELETE", "MODEL_GROUP_CREATE", "MODEL_GROUP_UPDATE", "MODEL_GROUP_DELETE", "MODEL_GROUP_VERSION_HISTORY_DELETE"]), help=u"""Filter results by the type of the operation associated with the work request.""") @cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED"]), help=u"""Filter results by work request status.""") @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. 1 is the minimum, 100 is the maximum. See [List Pagination]. @@ -10361,8 +10864,130 @@ def restore_archived_model_artifact(ctx, from_json, wait_for_state, max_wait_sec 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('data_science', 'data_science', ctx) - result = client.restore_archived_model_artifact( - model_id=model_id, + result = client.restore_archived_model_artifact( + model_id=model_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) + + +@ml_application_instance_group.command(name=cli_util.override('data_science.trigger_ml_application_instance_flow.command_name', 'trigger-ml-application-instance-flow'), help=u"""Trigger ML Application Instance flow if possible \n[Command Reference](triggerMlApplicationInstanceFlow)""") +@cli_util.option('--trigger-name', required=True, help=u"""Name of trigger""") +@cli_util.option('--ml-application-instance-id', required=True, help=u"""unique MlApplicationInstance identifier""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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 trigger_ml_application_instance_flow(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, trigger_name, ml_application_instance_id): + + if isinstance(ml_application_instance_id, six.string_types) and len(ml_application_instance_id.strip()) == 0: + raise click.UsageError('Parameter --ml-application-instance-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['triggerName'] = trigger_name + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.trigger_ml_application_instance_flow( + ml_application_instance_id=ml_application_instance_id, + trigger_ml_application_instance_flow_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) + + +@ml_application_instance_view_group.command(name=cli_util.override('data_science.trigger_ml_application_instance_view_flow.command_name', 'trigger-ml-application-instance-view-flow'), help=u"""Trigger ML Application Instance View flow if possible \n[Command Reference](triggerMlApplicationInstanceViewFlow)""") +@cli_util.option('--trigger-name', required=True, help=u"""Name of trigger""") +@cli_util.option('--ml-application-instance-view-id', required=True, help=u"""unique MlApplicationInstanceView identifier""") +@cli_util.option('--parameters', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Parameters provided for given trigger invocation (they must match predefined schema) + +This option is a JSON list with items of type TriggerParameter. For documentation on TriggerParameter please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datascience/20190101/datatypes/TriggerParameter.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "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({'parameters': {'module': 'data_science', 'class': 'list[TriggerParameter]'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'parameters': {'module': 'data_science', 'class': 'list[TriggerParameter]'}}) +@cli_util.wrap_exceptions +def trigger_ml_application_instance_view_flow(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, trigger_name, ml_application_instance_view_id, parameters): + + if isinstance(ml_application_instance_view_id, six.string_types) and len(ml_application_instance_view_id.strip()) == 0: + raise click.UsageError('Parameter --ml-application-instance-view-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['triggerName'] = trigger_name + + if parameters is not None: + _details['parameters'] = cli_util.parse_json_parameter("parameters", parameters) + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.trigger_ml_application_instance_view_flow( + ml_application_instance_view_id=ml_application_instance_view_id, + trigger_ml_application_instance_view_flow_details=_details, **kwargs ) if wait_for_state: @@ -10395,32 +11020,62 @@ def restore_archived_model_artifact(ctx, from_json, wait_for_state, max_wait_sec cli_util.render_response(result, ctx) -@ml_application_instance_group.command(name=cli_util.override('data_science.trigger_ml_application_instance_flow.command_name', 'trigger-ml-application-instance-flow'), help=u"""Trigger ML Application Instance flow if possible \n[Command Reference](triggerMlApplicationInstanceFlow)""") -@cli_util.option('--trigger-name', required=True, help=u"""Name of trigger""") -@cli_util.option('--ml-application-instance-id', required=True, help=u"""unique MlApplicationInstance identifier""") +@compute_target_group.command(name=cli_util.override('data_science.update_compute_target.command_name', 'update'), help=u"""Updates the compute target. \n[Command Reference](updateComputeTarget)""") +@cli_util.option('--compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") +@cli_util.option('--display-name', help=u"""A user-friendly display name for the resource.""") +@cli_util.option('--description', help=u"""A short description of the compute target.""") +@cli_util.option('--metadata', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Metadata for the compute target. The size of metadata must be less than 2048 bytes. Key should be under 32 characters. Key should contain only letters, digits and underscore (_) Key should start with a letter. Key should have at least 2 characters. Key should not end with underscore eg. `TEST_` Key if added cannot be empty. Value can be empty. No specific size limits on individual Values. But overall metadata is limited to 2048 bytes. Key can't be reserved Compute Target metadata.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--compute-configuration-details', 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. 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. 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 is 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", "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({}) +@json_skeleton_utils.get_cli_json_input_option({'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'compute-configuration-details': {'module': 'data_science', 'class': 'UpdateComputeConfigurationDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', '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={}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'compute-configuration-details': {'module': 'data_science', 'class': 'UpdateComputeConfigurationDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}}) @cli_util.wrap_exceptions -def trigger_ml_application_instance_flow(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, trigger_name, ml_application_instance_id): +def update_compute_target(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, compute_target_id, display_name, description, metadata, compute_configuration_details, freeform_tags, defined_tags, if_match): - if isinstance(ml_application_instance_id, six.string_types) and len(ml_application_instance_id.strip()) == 0: - raise click.UsageError('Parameter --ml-application-instance-id cannot be whitespace or empty string') + if isinstance(compute_target_id, six.string_types) and len(compute_target_id.strip()) == 0: + raise click.UsageError('Parameter --compute-target-id cannot be whitespace or empty string') + if not force: + if metadata or compute_configuration_details or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to metadata and compute-configuration-details 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 = {} - _details['triggerName'] = trigger_name + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if metadata is not None: + _details['metadata'] = cli_util.parse_json_parameter("metadata", metadata) + + if compute_configuration_details is not None: + _details['computeConfigurationDetails'] = cli_util.parse_json_parameter("compute_configuration_details", compute_configuration_details) + + 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('data_science', 'data_science', ctx) - result = client.trigger_ml_application_instance_flow( - ml_application_instance_id=ml_application_instance_id, - trigger_ml_application_instance_flow_details=_details, + result = client.update_compute_target( + compute_target_id=compute_target_id, + update_compute_target_details=_details, **kwargs ) if wait_for_state: @@ -10453,38 +11108,69 @@ def trigger_ml_application_instance_flow(ctx, from_json, wait_for_state, max_wai cli_util.render_response(result, ctx) -@ml_application_instance_view_group.command(name=cli_util.override('data_science.trigger_ml_application_instance_view_flow.command_name', 'trigger-ml-application-instance-view-flow'), help=u"""Trigger ML Application Instance View flow if possible \n[Command Reference](triggerMlApplicationInstanceViewFlow)""") -@cli_util.option('--trigger-name', required=True, help=u"""Name of trigger""") -@cli_util.option('--ml-application-instance-view-id', required=True, help=u"""unique MlApplicationInstanceView identifier""") -@cli_util.option('--parameters', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Parameters provided for given trigger invocation (they must match predefined schema) - -This option is a JSON list with items of type TriggerParameter. For documentation on TriggerParameter please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datascience/20190101/datatypes/TriggerParameter.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@compute_target_group.command(name=cli_util.override('data_science.update_compute_target_update_managed_compute_cluster_configuration_details.command_name', 'update-compute-target-update-managed-compute-cluster-configuration-details'), help=u"""Updates the compute target. \n[Command Reference](updateComputeTarget)""") +@cli_util.option('--compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") +@cli_util.option('--display-name', help=u"""A user-friendly display name for the resource.""") +@cli_util.option('--description', help=u"""A short description of the compute target.""") +@cli_util.option('--metadata', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Metadata for the compute target. The size of metadata must be less than 2048 bytes. Key should be under 32 characters. Key should contain only letters, digits and underscore (_) Key should start with a letter. Key should have at least 2 characters. Key should not end with underscore eg. `TEST_` Key if added cannot be empty. Value can be empty. No specific size limits on individual Values. But overall metadata is limited to 2048 bytes. Key can't be reserved Compute Target metadata.""" + 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. 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. 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 is updated or deleted only if the `etag` you provide matches the resource's current `etag` value.""") +@cli_util.option('--compute-configuration-details-instance-configuration', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--compute-configuration-details-scaling-policy', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@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", "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({'parameters': {'module': 'data_science', 'class': 'list[TriggerParameter]'}}) +@json_skeleton_utils.get_cli_json_input_option({'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'compute-configuration-details-instance-configuration': {'module': 'data_science', 'class': 'UpdateManagedComputeClusterInstanceConfigurationDetails'}, 'compute-configuration-details-scaling-policy': {'module': 'data_science', 'class': 'ManagedComputeClusterScalingPolicy'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'parameters': {'module': 'data_science', 'class': 'list[TriggerParameter]'}}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'metadata': {'module': 'data_science', 'class': 'dict(str, string)'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'compute-configuration-details-instance-configuration': {'module': 'data_science', 'class': 'UpdateManagedComputeClusterInstanceConfigurationDetails'}, 'compute-configuration-details-scaling-policy': {'module': 'data_science', 'class': 'ManagedComputeClusterScalingPolicy'}}) @cli_util.wrap_exceptions -def trigger_ml_application_instance_view_flow(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, trigger_name, ml_application_instance_view_id, parameters): +def update_compute_target_update_managed_compute_cluster_configuration_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, compute_target_id, display_name, description, metadata, freeform_tags, defined_tags, if_match, compute_configuration_details_instance_configuration, compute_configuration_details_scaling_policy): - if isinstance(ml_application_instance_view_id, six.string_types) and len(ml_application_instance_view_id.strip()) == 0: - raise click.UsageError('Parameter --ml-application-instance-view-id cannot be whitespace or empty string') + if isinstance(compute_target_id, six.string_types) and len(compute_target_id.strip()) == 0: + raise click.UsageError('Parameter --compute-target-id cannot be whitespace or empty string') + if not force: + if metadata or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to metadata 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 = {} - _details['triggerName'] = trigger_name + _details['computeConfigurationDetails'] = {} - if parameters is not None: - _details['parameters'] = cli_util.parse_json_parameter("parameters", parameters) + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if metadata is not None: + _details['metadata'] = cli_util.parse_json_parameter("metadata", metadata) + + 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 compute_configuration_details_instance_configuration is not None: + _details['computeConfigurationDetails']['instanceConfiguration'] = cli_util.parse_json_parameter("compute_configuration_details_instance_configuration", compute_configuration_details_instance_configuration) + + if compute_configuration_details_scaling_policy is not None: + _details['computeConfigurationDetails']['scalingPolicy'] = cli_util.parse_json_parameter("compute_configuration_details_scaling_policy", compute_configuration_details_scaling_policy) + + _details['computeConfigurationDetails']['computeType'] = 'MANAGED_COMPUTE_CLUSTER' client = cli_util.build_client('data_science', 'data_science', ctx) - result = client.trigger_ml_application_instance_view_flow( - ml_application_instance_view_id=ml_application_instance_view_id, - trigger_ml_application_instance_view_flow_details=_details, + result = client.update_compute_target( + compute_target_id=compute_target_id, + update_compute_target_details=_details, **kwargs ) if wait_for_state: @@ -10958,6 +11644,95 @@ def update_job_managed_egress_standalone_job_infrastructure_configuration_detail cli_util.render_response(result, ctx) +@job_group.command(name=cli_util.override('data_science.update_job_managed_compute_cluster_job_infrastructure_configuration_details.command_name', 'update-job-managed-compute-cluster-job-infrastructure-configuration-details'), help=u"""Updates a job. \n[Command Reference](updateJob)""") +@cli_util.option('--job-id', required=True, help=u"""The [OCID] of the job.""") +@cli_util.option('--job-infrastructure-configuration-details-compute-target-id', required=True, help=u"""The [OCID] of the compute target.""") +@cli_util.option('--job-infrastructure-configuration-details-resource-configuration', required=True, 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 display name for the resource.""") +@cli_util.option('--description', help=u"""A short description of the job.""") +@cli_util.option('--job-storage-mount-configuration-details-list', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of JobStorageMountConfigurationDetails. + +This option is a JSON list with items of type StorageMountConfigurationDetails. For documentation on StorageMountConfigurationDetails please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/datascience/20190101/datatypes/StorageMountConfigurationDetails.""" + 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. 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. 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 is 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(["CREATING", "ACTIVE", "DELETING", "FAILED", "DELETED"]), 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 CREATING --wait-for-state DELETED 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({'job-storage-mount-configuration-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-details-resource-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterJobResourceConfiguration'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'job-storage-mount-configuration-details-list': {'module': 'data_science', 'class': 'list[StorageMountConfigurationDetails]'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'job-infrastructure-configuration-details-resource-configuration': {'module': 'data_science', 'class': 'ManagedComputeClusterJobResourceConfiguration'}}, output_type={'module': 'data_science', 'class': 'Job'}) +@cli_util.wrap_exceptions +def update_job_managed_compute_cluster_job_infrastructure_configuration_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, job_id, job_infrastructure_configuration_details_compute_target_id, job_infrastructure_configuration_details_resource_configuration, display_name, description, job_storage_mount_configuration_details_list, freeform_tags, defined_tags, if_match): + + if isinstance(job_id, six.string_types) and len(job_id.strip()) == 0: + raise click.UsageError('Parameter --job-id cannot be whitespace or empty string') + if not force: + if job_storage_mount_configuration_details_list or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to job-storage-mount-configuration-details-list 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 = {} + _details['jobInfrastructureConfigurationDetails'] = {} + _details['jobInfrastructureConfigurationDetails']['computeTargetId'] = job_infrastructure_configuration_details_compute_target_id + _details['jobInfrastructureConfigurationDetails']['resourceConfiguration'] = cli_util.parse_json_parameter("job_infrastructure_configuration_details_resource_configuration", job_infrastructure_configuration_details_resource_configuration) + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if job_storage_mount_configuration_details_list is not None: + _details['jobStorageMountConfigurationDetailsList'] = cli_util.parse_json_parameter("job_storage_mount_configuration_details_list", job_storage_mount_configuration_details_list) + + 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) + + _details['jobInfrastructureConfigurationDetails']['jobInfrastructureType'] = 'MANAGED_COMPUTE_CLUSTER' + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.update_job( + job_id=job_id, + update_job_details=_details, + **kwargs + ) + if wait_for_state: + + if hasattr(client, 'get_job') and callable(getattr(client, 'get_job')): + 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_job(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) + + @job_group.command(name=cli_util.override('data_science.update_job_standalone_job_infrastructure_configuration_details.command_name', 'update-job-standalone-job-infrastructure-configuration-details'), help=u"""Updates a job. \n[Command Reference](updateJob)""") @cli_util.option('--job-id', required=True, help=u"""The [OCID] of the job.""") @cli_util.option('--job-infrastructure-configuration-details-shape-name', required=True, help=u"""The shape used to launch the job run instances.""") @@ -11973,6 +12748,105 @@ def update_model_deployment_update_single_model_deployment_configuration_details cli_util.render_response(result, ctx) +@model_deployment_group.command(name=cli_util.override('data_science.update_model_deployment_update_single_model_deployment_flex_configuration_details.command_name', 'update-model-deployment-update-single-model-deployment-flex-configuration-details'), help=u"""Updates the properties of a model deployment. Some of the properties of `modelDeploymentConfigurationDetails` or `CategoryLogDetails` can also be updated with zero down time when the model deployment's lifecycle state is ACTIVE or NEEDS_ATTENTION i.e `instanceShapeName`, `instanceCount` and `modelId`, separately `loadBalancerShape` or `CategoryLogDetails` can also be updated independently. All of the fields can be updated when the deployment is in the INACTIVE lifecycle state. Changes will take effect the next time the model deployment is activated. \n[Command Reference](updateModelDeployment)""") +@cli_util.option('--model-deployment-id', required=True, help=u"""The [OCID] of the model deployment.""") +@cli_util.option('--display-name', help=u"""A user-friendly display name for the resource. Does not have to be unique, and can be modified. Avoid entering confidential information. Example: `My ModelDeployment`""") +@cli_util.option('--description', help=u"""A short description of the model deployment.""") +@cli_util.option('--category-log-details', 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. 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. 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 is updated or deleted only if the `etag` you provide matches the resource's current `etag` value.""") +@cli_util.option('--model-deployment-configuration-details-model-configuration-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--model-deployment-configuration-details-infrastructure-configuration-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--model-deployment-configuration-details-environment-configuration-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@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", "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({'category-log-details': {'module': 'data_science', 'class': 'UpdateCategoryLogDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'model-deployment-configuration-details-model-configuration-details': {'module': 'data_science', 'class': 'UpdateSingleModelConfigurationDetails'}, 'model-deployment-configuration-details-infrastructure-configuration-details': {'module': 'data_science', 'class': 'UpdateModelDeployInfrastructureConfigurationDetails'}, 'model-deployment-configuration-details-environment-configuration-details': {'module': 'data_science', 'class': 'UpdateModelDeploymentEnvironmentConfigurationDetails'}}) +@cli_util.help_option +@click.pass_context +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'category-log-details': {'module': 'data_science', 'class': 'UpdateCategoryLogDetails'}, 'freeform-tags': {'module': 'data_science', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'data_science', 'class': 'dict(str, dict(str, object))'}, 'model-deployment-configuration-details-model-configuration-details': {'module': 'data_science', 'class': 'UpdateSingleModelConfigurationDetails'}, 'model-deployment-configuration-details-infrastructure-configuration-details': {'module': 'data_science', 'class': 'UpdateModelDeployInfrastructureConfigurationDetails'}, 'model-deployment-configuration-details-environment-configuration-details': {'module': 'data_science', 'class': 'UpdateModelDeploymentEnvironmentConfigurationDetails'}}) +@cli_util.wrap_exceptions +def update_model_deployment_update_single_model_deployment_flex_configuration_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, model_deployment_id, display_name, description, category_log_details, freeform_tags, defined_tags, if_match, model_deployment_configuration_details_model_configuration_details, model_deployment_configuration_details_infrastructure_configuration_details, model_deployment_configuration_details_environment_configuration_details): + + if isinstance(model_deployment_id, six.string_types) and len(model_deployment_id.strip()) == 0: + raise click.UsageError('Parameter --model-deployment-id cannot be whitespace or empty string') + if not force: + if category_log_details or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to category-log-details 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 = {} + _details['modelDeploymentConfigurationDetails'] = {} + + if display_name is not None: + _details['displayName'] = display_name + + if description is not None: + _details['description'] = description + + if category_log_details is not None: + _details['categoryLogDetails'] = cli_util.parse_json_parameter("category_log_details", category_log_details) + + 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 model_deployment_configuration_details_model_configuration_details is not None: + _details['modelDeploymentConfigurationDetails']['modelConfigurationDetails'] = cli_util.parse_json_parameter("model_deployment_configuration_details_model_configuration_details", model_deployment_configuration_details_model_configuration_details) + + if model_deployment_configuration_details_infrastructure_configuration_details is not None: + _details['modelDeploymentConfigurationDetails']['infrastructureConfigurationDetails'] = cli_util.parse_json_parameter("model_deployment_configuration_details_infrastructure_configuration_details", model_deployment_configuration_details_infrastructure_configuration_details) + + if model_deployment_configuration_details_environment_configuration_details is not None: + _details['modelDeploymentConfigurationDetails']['environmentConfigurationDetails'] = cli_util.parse_json_parameter("model_deployment_configuration_details_environment_configuration_details", model_deployment_configuration_details_environment_configuration_details) + + _details['modelDeploymentConfigurationDetails']['deploymentType'] = 'SINGLE_MODEL_FLEX' + + client = cli_util.build_client('data_science', 'data_science', ctx) + result = client.update_model_deployment( + model_deployment_id=model_deployment_id, + update_model_deployment_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) + + @model_group_group.command(name=cli_util.override('data_science.update_model_group.command_name', 'update'), help=u"""Updates the properties of the Model Group. \n[Command Reference](updateModelGroup)""") @cli_util.option('--model-group-id', required=True, help=u"""The [OCID] of the modelGroup.""") @cli_util.option('--display-name', help=u"""A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. Example: `My ModelGroup`""") diff --git a/services/data_science/tests/util/generated/command_to_api.py b/services/data_science/tests/util/generated/command_to_api.py index 8c8c4ce52..0e497b9b1 100644 --- a/services/data_science/tests/util/generated/command_to_api.py +++ b/services/data_science/tests/util/generated/command_to_api.py @@ -10,6 +10,7 @@ "data_science.cancel_job_run": "oci.data_science.DataScienceClient.cancel_job_run", "data_science.cancel_pipeline_run": "oci.data_science.DataScienceClient.cancel_pipeline_run", "data_science.cancel_work_request": "oci.data_science.DataScienceClient.cancel_work_request", + "data_science.change_compute_target_compartment": "oci.data_science.DataScienceClient.change_compute_target_compartment", "data_science.change_data_science_private_endpoint_compartment": "oci.data_science.DataScienceClient.change_data_science_private_endpoint_compartment", "data_science.change_job_compartment": "oci.data_science.DataScienceClient.change_job_compartment", "data_science.change_job_run_compartment": "oci.data_science.DataScienceClient.change_job_run_compartment", @@ -27,6 +28,7 @@ "data_science.change_pipeline_run_compartment": "oci.data_science.DataScienceClient.change_pipeline_run_compartment", "data_science.change_project_compartment": "oci.data_science.DataScienceClient.change_project_compartment", "data_science.change_schedule_compartment": "oci.data_science.DataScienceClient.change_schedule_compartment", + "data_science.create_compute_target": "oci.data_science.DataScienceClient.create_compute_target", "data_science.create_data_science_private_endpoint": "oci.data_science.DataScienceClient.create_data_science_private_endpoint", "data_science.create_job": "oci.data_science.DataScienceClient.create_job", "data_science.create_job_artifact": "oci.data_science.DataScienceClient.create_job_artifact", @@ -55,6 +57,7 @@ "data_science.deactivate_model_group": "oci.data_science.DataScienceClient.deactivate_model_group", "data_science.deactivate_notebook_session": "oci.data_science.DataScienceClient.deactivate_notebook_session", "data_science.deactivate_schedule": "oci.data_science.DataScienceClient.deactivate_schedule", + "data_science.delete_compute_target": "oci.data_science.DataScienceClient.delete_compute_target", "data_science.delete_data_science_private_endpoint": "oci.data_science.DataScienceClient.delete_data_science_private_endpoint", "data_science.delete_job": "oci.data_science.DataScienceClient.delete_job", "data_science.delete_job_run": "oci.data_science.DataScienceClient.delete_job_run", @@ -76,6 +79,7 @@ "data_science.disable_ml_application_instance_view_trigger": "oci.data_science.DataScienceClient.disable_ml_application_instance_view_trigger", "data_science.enable_ml_application_instance_view_trigger": "oci.data_science.DataScienceClient.enable_ml_application_instance_view_trigger", "data_science.export_model_artifact": "oci.data_science.DataScienceClient.export_model_artifact", + "data_science.get_compute_target": "oci.data_science.DataScienceClient.get_compute_target", "data_science.get_data_science_private_endpoint": "oci.data_science.DataScienceClient.get_data_science_private_endpoint", "data_science.get_job": "oci.data_science.DataScienceClient.get_job", "data_science.get_job_artifact_content": "oci.data_science.DataScienceClient.get_job_artifact_content", @@ -111,6 +115,8 @@ "data_science.head_model_group_artifact": "oci.data_science.DataScienceClient.head_model_group_artifact", "data_science.head_step_artifact": "oci.data_science.DataScienceClient.head_step_artifact", "data_science.import_model_artifact": "oci.data_science.DataScienceClient.import_model_artifact", + "data_science.list_compute_target_shapes": "oci.data_science.DataScienceClient.list_compute_target_shapes", + "data_science.list_compute_targets": "oci.data_science.DataScienceClient.list_compute_targets", "data_science.list_containers": "oci.data_science.DataScienceClient.list_containers", "data_science.list_data_science_private_endpoints": "oci.data_science.DataScienceClient.list_data_science_private_endpoints", "data_science.list_fast_launch_job_configs": "oci.data_science.DataScienceClient.list_fast_launch_job_configs", @@ -145,6 +151,7 @@ "data_science.restore_archived_model_artifact": "oci.data_science.DataScienceClient.restore_archived_model_artifact", "data_science.trigger_ml_application_instance_flow": "oci.data_science.DataScienceClient.trigger_ml_application_instance_flow", "data_science.trigger_ml_application_instance_view_flow": "oci.data_science.DataScienceClient.trigger_ml_application_instance_view_flow", + "data_science.update_compute_target": "oci.data_science.DataScienceClient.update_compute_target", "data_science.update_data_science_private_endpoint": "oci.data_science.DataScienceClient.update_data_science_private_endpoint", "data_science.update_job": "oci.data_science.DataScienceClient.update_job", "data_science.update_job_run": "oci.data_science.DataScienceClient.update_job_run", 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 05eb46dab..9f310a097 100644 --- a/services/database/src/oci_cli_database/generated/database_cli.py +++ b/services/database/src/oci_cli_database/generated/database_cli.py @@ -440,7 +440,7 @@ def db_system_os_patch_history_entry_group(): pass -@click.command(cli_util.override('db.exadata_infrastructure_un_allocated_resources_group.command_name', 'exadata-infrastructure-un-allocated-resources'), cls=CommandGroupWithAlias, help="""Un allocated resources details of the Exadata Cloud@Customer infrastructure. Applies to Exadata Cloud@Customer instances only.""") +@click.command(cli_util.override('db.exadata_infrastructure_un_allocated_resources_group.command_name', 'exadata-infrastructure-un-allocated-resources'), cls=CommandGroupWithAlias, help="""Displays details of unallocated resources for the Exadata Cloud@Customer infrastructure. Applies to Exadata Cloud@Customer instances only.""") @cli_util.help_option_group def exadata_infrastructure_un_allocated_resources_group(): pass @@ -4957,9 +4957,9 @@ def create_application_vip(ctx, from_json, wait_for_state, max_wait_seconds, wai @cli_util.option('--key-store-id', help=u"""The [OCID] of the key store of Oracle Vault.""") @cli_util.option('--encryption-key-location-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") -@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") @cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") -@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -5162,9 +5162,9 @@ def create_autonomous_container_database(ctx, from_json, wait_for_state, max_wai @cli_util.option('--key-store-id', help=u"""The [OCID] of the key store of Oracle Vault.""") @cli_util.option('--encryption-key-location-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") -@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") @cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") -@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -5367,9 +5367,9 @@ def create_autonomous_container_database_create_autonomous_container_database_de @cli_util.option('--key-store-id', help=u"""The [OCID] of the key store of Oracle Vault.""") @cli_util.option('--encryption-key-location-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") -@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") @cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") -@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -5572,9 +5572,9 @@ def create_autonomous_container_database_create_autonomous_container_database_fr @cli_util.option('--vault-id', help=u"""The [OCID] of the Oracle Cloud Infrastructure [vault]. This parameter and `secretId` are required for Customer Managed Keys.""") @cli_util.option('--key-store-id', help=u"""The [OCID] of the key store of Oracle Vault.""") @cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") -@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") @cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") -@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -5775,9 +5775,9 @@ def create_autonomous_container_database_external_hsm_encryption_details(ctx, fr @cli_util.option('--vault-id', help=u"""The [OCID] of the Oracle Cloud Infrastructure [vault]. This parameter and `secretId` are required for Customer Managed Keys.""") @cli_util.option('--key-store-id', help=u"""The [OCID] of the key store of Oracle Vault.""") @cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") -@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") @cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") -@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -5978,9 +5978,9 @@ def create_autonomous_container_database_google_cloud_provider_encryption_key_de @cli_util.option('--vault-id', help=u"""The [OCID] of the Oracle Cloud Infrastructure [vault]. This parameter and `secretId` are required for Customer Managed Keys.""") @cli_util.option('--key-store-id', help=u"""The [OCID] of the key store of Oracle Vault.""") @cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") -@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") @cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") -@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -6181,9 +6181,9 @@ def create_autonomous_container_database_azure_encryption_key_details(ctx, from_ @cli_util.option('--vault-id', help=u"""The [OCID] of the Oracle Cloud Infrastructure [vault]. This parameter and `secretId` are required for Customer Managed Keys.""") @cli_util.option('--key-store-id', help=u"""The [OCID] of the key store of Oracle Vault.""") @cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") -@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") @cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") -@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -6455,7 +6455,7 @@ def create_autonomous_container_database_dataguard_association(ctx, from_json, w **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -6796,7 +6796,7 @@ def create_autonomous_database(ctx, from_json, wait_for_state, max_wait_seconds, **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -7135,7 +7135,7 @@ def create_autonomous_database_undelete_autonomous_database_details(ctx, from_js **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -7474,7 +7474,7 @@ def create_autonomous_database_create_autonomous_database_clone_details(ctx, fro **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -7839,7 +7839,7 @@ def create_autonomous_database_create_refreshable_autonomous_database_clone_deta **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -8183,7 +8183,7 @@ def create_autonomous_database_create_autonomous_database_from_backup_details(ct **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -8527,7 +8527,7 @@ def create_autonomous_database_create_cross_region_disaster_recovery_details(ctx **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -8879,7 +8879,7 @@ def create_autonomous_database_create_autonomous_database_from_backup_timestamp_ **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -9222,7 +9222,7 @@ def create_autonomous_database_create_cross_tenancy_disaster_recovery_details(ct **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -9559,7 +9559,7 @@ def create_autonomous_database_create_cross_region_autonomous_database_data_guar **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -9899,7 +9899,7 @@ def create_autonomous_database_create_autonomous_database_details(ctx, from_json **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -10242,7 +10242,7 @@ def create_autonomous_database_okv_key_details(ctx, from_json, wait_for_state, m **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -10579,7 +10579,7 @@ def create_autonomous_database_azure_key_details(ctx, from_json, wait_for_state, **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -10924,7 +10924,7 @@ def create_autonomous_database_aws_key_details(ctx, from_json, wait_for_state, m **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -11263,7 +11263,7 @@ def create_autonomous_database_oci_key_details(ctx, from_json, wait_for_state, m **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -11604,7 +11604,7 @@ def create_autonomous_database_gcp_key_details(ctx, from_json, wait_for_state, m **Note:** This parameter cannot be used with the `cpuCoreCount` parameter.""") @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. +**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('--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. This storage can later be scaled up if needed. 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). @@ -12067,6 +12067,8 @@ def create_autonomous_database_software_image(ctx, from_json, wait_for_state, ma @cli_util.option('--scan-listener-port-tls', type=click.INT, help=u"""The SCAN Listener TLS port number. Default value is 2484.""") @cli_util.option('--scan-listener-port-non-tls', type=click.INT, help=u"""The SCAN Listener Non TLS port number. Default value is 1521.""") @cli_util.option('--is-mtls-enabled', type=click.BOOL, help=u"""Enable mutual TLS(mTLS) authentication for database while provisioning a VMCluster. Default is TLS.""") +@cli_util.option('--distribution-algorithm', type=custom_types.CliCaseInsensitiveChoice(["RESOURCE_OPTIMIZED", "DISTRIBUTION_OPTIMIZED"]), help=u"""The distribution algorithm used for the Autonomous VM cluster.""") +@cli_util.option('--sga-percentage', type=click.FLOAT, help=u"""Percentage of ECPU memory allocated for SGA(System Global Area).""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "MAINTENANCE_IN_PROGRESS"]), 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 MAINTENANCE_IN_PROGRESS 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.""") @@ -12075,7 +12077,7 @@ def create_autonomous_database_software_image(ctx, from_json, wait_for_state, ma @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'maintenance-window-details': {'module': 'database', 'class': 'MaintenanceWindow'}, 'db-servers': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'AutonomousVmCluster'}) @cli_util.wrap_exceptions -def create_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, exadata_infrastructure_id, vm_cluster_network_id, time_zone, is_local_backup_enabled, license_model, total_container_databases, cpu_core_count_per_node, compute_model, memory_per_oracle_compute_unit_in_gbs, autonomous_data_storage_size_in_tbs, maintenance_window_details, db_servers, freeform_tags, defined_tags, scan_listener_port_tls, scan_listener_port_non_tls, is_mtls_enabled): +def create_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, exadata_infrastructure_id, vm_cluster_network_id, time_zone, is_local_backup_enabled, license_model, total_container_databases, cpu_core_count_per_node, compute_model, memory_per_oracle_compute_unit_in_gbs, autonomous_data_storage_size_in_tbs, maintenance_window_details, db_servers, freeform_tags, defined_tags, scan_listener_port_tls, scan_listener_port_non_tls, is_mtls_enabled, distribution_algorithm, sga_percentage): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -12131,6 +12133,12 @@ def create_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_second if is_mtls_enabled is not None: _details['isMtlsEnabled'] = is_mtls_enabled + if distribution_algorithm is not None: + _details['distributionAlgorithm'] = distribution_algorithm + + if sga_percentage is not None: + _details['sgaPercentage'] = sga_percentage + client = cli_util.build_client('database', 'database', ctx) result = client.create_autonomous_vm_cluster( create_autonomous_vm_cluster_details=_details, @@ -12434,6 +12442,8 @@ def create_backup_destination_create_recovery_appliance_backup_destination_detai @cli_util.option('--cluster-time-zone', help=u"""The time zone to use for the Cloud Autonomous VM cluster. For details, see [DB System Time Zones].""") @cli_util.option('--compute-model', type=custom_types.CliCaseInsensitiveChoice(["ECPU", "OCPU"]), help=u"""The compute model of the Cloud Autonomous VM Cluster. ECPU compute model is the recommended model and OCPU compute model is legacy.""") @cli_util.option('--is-mtls-enabled-vm-cluster', type=click.BOOL, help=u"""Enable mutual TLS(mTLS) authentication for database at time of provisioning a VMCluster. This is applicable to database TLS Certificates only. Default is TLS""") +@cli_util.option('--distribution-algorithm', type=custom_types.CliCaseInsensitiveChoice(["RESOURCE_OPTIMIZED", "DISTRIBUTION_OPTIMIZED"]), help=u"""The distribution algorithm used for the Autonomous VM cluster.""") +@cli_util.option('--sga-percentage', type=click.FLOAT, help=u"""Percentage of ECPU memory allocated for SGA(System Global Area).""") @cli_util.option('--db-servers', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The list of database servers.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--maintenance-window-details', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--scan-listener-port-tls', type=click.INT, help=u"""The SCAN Listener TLS port. Default is 2484.""") @@ -12457,7 +12467,7 @@ def create_backup_destination_create_recovery_appliance_backup_destination_detai @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'db-servers': {'module': 'database', 'class': 'list[string]'}, 'maintenance-window-details': {'module': 'database', 'class': 'MaintenanceWindow'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'CloudAutonomousVmCluster'}) @cli_util.wrap_exceptions -def create_cloud_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subnet_id, display_name, cloud_exadata_infrastructure_id, description, total_container_databases, cpu_core_count_per_node, memory_per_oracle_compute_unit_in_gbs, autonomous_data_storage_size_in_tbs, cluster_time_zone, compute_model, is_mtls_enabled_vm_cluster, db_servers, maintenance_window_details, scan_listener_port_tls, scan_listener_port_non_tls, license_model, nsg_ids, freeform_tags, defined_tags, security_attributes, subscription_id, opc_dry_run): +def create_cloud_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subnet_id, display_name, cloud_exadata_infrastructure_id, description, total_container_databases, cpu_core_count_per_node, memory_per_oracle_compute_unit_in_gbs, autonomous_data_storage_size_in_tbs, cluster_time_zone, compute_model, is_mtls_enabled_vm_cluster, distribution_algorithm, sga_percentage, db_servers, maintenance_window_details, scan_listener_port_tls, scan_listener_port_non_tls, license_model, nsg_ids, freeform_tags, defined_tags, security_attributes, subscription_id, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -12494,6 +12504,12 @@ def create_cloud_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_ if is_mtls_enabled_vm_cluster is not None: _details['isMtlsEnabledVmCluster'] = is_mtls_enabled_vm_cluster + if distribution_algorithm is not None: + _details['distributionAlgorithm'] = distribution_algorithm + + if sga_percentage is not None: + _details['sgaPercentage'] = sga_percentage + if db_servers is not None: _details['dbServers'] = cli_util.parse_json_parameter("db_servers", db_servers) @@ -12563,6 +12579,7 @@ def create_cloud_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_ @cli_util.option('--compute-count', type=click.INT, help=u"""The number of compute servers for the cloud Exadata infrastructure.""") @cli_util.option('--storage-count', type=click.INT, help=u"""The number of storage servers for the cloud Exadata infrastructure.""") @cli_util.option('--maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--maintenance-version-preferences', 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) @@ -12578,12 +12595,12 @@ def create_cloud_autonomous_vm_cluster(ctx, from_json, wait_for_state, max_wait_ @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "MAINTENANCE_IN_PROGRESS"]), 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 MAINTENANCE_IN_PROGRESS 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({'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}) +@json_skeleton_utils.get_cli_json_input_option({'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}, output_type={'module': 'database', 'class': 'CloudExadataInfrastructure'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}, output_type={'module': 'database', 'class': 'CloudExadataInfrastructure'}) @cli_util.wrap_exceptions -def create_cloud_exadata_infrastructure(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, availability_domain, compartment_id, display_name, shape, compute_count, storage_count, maintenance_window, freeform_tags, defined_tags, cluster_placement_group_id, subscription_id, customer_contacts, database_server_type, storage_server_type, opc_dry_run): +def create_cloud_exadata_infrastructure(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, availability_domain, compartment_id, display_name, shape, compute_count, storage_count, maintenance_window, maintenance_version_preferences, freeform_tags, defined_tags, cluster_placement_group_id, subscription_id, customer_contacts, database_server_type, storage_server_type, opc_dry_run): kwargs = {} if opc_dry_run is not None: @@ -12605,6 +12622,9 @@ def create_cloud_exadata_infrastructure(ctx, from_json, wait_for_state, max_wait if maintenance_window is not None: _details['maintenanceWindow'] = cli_util.parse_json_parameter("maintenance_window", maintenance_window) + if maintenance_version_preferences is not None: + _details['maintenanceVersionPreferences'] = cli_util.parse_json_parameter("maintenance_version_preferences", maintenance_version_preferences) + if freeform_tags is not None: _details['freeformTags'] = cli_util.parse_json_parameter("freeform_tags", freeform_tags) @@ -15008,6 +15028,7 @@ def create_db_home_create_db_home_with_vm_cluster_id_details(ctx, from_json, wai This option is a JSON list with items of type ExadataInfrastructureContact. For documentation on ExadataInfrastructureContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ExadataInfrastructureContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--maintenance-version-preferences', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--storage-count', type=click.INT, help=u"""The number of storage servers for the Exadata infrastructure.""") @cli_util.option('--compute-count', type=click.INT, help=u"""The number of compute servers for the Exadata infrastructure.""") @cli_util.option('--is-multi-rack-deployment', type=click.BOOL, help=u"""Indicates if deployment is Multi-Rack or not.""") @@ -15023,12 +15044,12 @@ def create_db_home_create_db_home_with_vm_cluster_id_details(ctx, from_json, wai @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "REQUIRES_ACTIVATION", "ACTIVATING", "ACTIVE", "ACTIVATION_FAILED", "FAILED", "UPDATING", "DELETING", "DELETED", "DISCONNECTED", "MAINTENANCE_IN_PROGRESS", "WAITING_FOR_CONNECTIVITY"]), 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 CREATING --wait-for-state WAITING_FOR_CONNECTIVITY 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({'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}) +@json_skeleton_utils.get_cli_json_input_option({'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', '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={'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'ExadataInfrastructure'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'ExadataInfrastructure'}) @cli_util.wrap_exceptions -def create_exadata_infrastructure(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, shape, time_zone, cloud_control_plane_server1, cloud_control_plane_server2, netmask, gateway, admin_network_cidr, infini_band_network_cidr, dns_server, ntp_server, corporate_proxy, contacts, maintenance_window, storage_count, compute_count, is_multi_rack_deployment, multi_rack_configuration_file, is_cps_offline_report_enabled, network_bonding_mode_details, database_server_type, storage_server_type, freeform_tags, defined_tags): +def create_exadata_infrastructure(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, display_name, shape, time_zone, cloud_control_plane_server1, cloud_control_plane_server2, netmask, gateway, admin_network_cidr, infini_band_network_cidr, dns_server, ntp_server, corporate_proxy, contacts, maintenance_window, maintenance_version_preferences, storage_count, compute_count, is_multi_rack_deployment, multi_rack_configuration_file, is_cps_offline_report_enabled, network_bonding_mode_details, database_server_type, storage_server_type, freeform_tags, defined_tags): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -15056,6 +15077,9 @@ def create_exadata_infrastructure(ctx, from_json, wait_for_state, max_wait_secon if maintenance_window is not None: _details['maintenanceWindow'] = cli_util.parse_json_parameter("maintenance_window", maintenance_window) + if maintenance_version_preferences is not None: + _details['maintenanceVersionPreferences'] = cli_util.parse_json_parameter("maintenance_version_preferences", maintenance_version_preferences) + if storage_count is not None: _details['storageCount'] = storage_count @@ -15363,7 +15387,7 @@ def create_exascale_db_storage_vault(ctx, from_json, wait_for_state, max_wait_se @execution_action_group.command(name=cli_util.override('db.create_execution_action.command_name', 'create'), help=u"""Creates an execution action resource. \n[Command Reference](createExecutionAction)""") @cli_util.option('--execution-window-id', required=True, help=u"""The [OCID] of the execution window resource the execution action belongs to.""") -@cli_util.option('--action-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DB_SERVER_FULL_SOFTWARE_UPDATE", "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE"]), help=u"""The action type of the execution action being performed""") +@cli_util.option('--action-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DB_SERVER_FULL_SOFTWARE_UPDATE", "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", "DB_SERVER_ONLINE_SOFTWARE_UPDATE"]), help=u"""The action type of the execution action being performed""") @cli_util.option('--compartment-id', help=u"""The [OCID] of the compartment.""") @cli_util.option('--action-params', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Map where a key value pair describes the specific action parameter. Example: `{\"count\": \"3\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--action-members', type=custom_types.CLI_COMPLEX_TYPE, help=u"""List of action members of this execution action. @@ -16600,7 +16624,7 @@ def create_pluggable_database_snapshot(ctx, from_json, wait_for_state, max_wait_ @scheduled_action_group.command(name=cli_util.override('db.create_scheduled_action.command_name', 'create'), help=u"""Creates a Scheduled Action resource. \n[Command Reference](createScheduledAction)""") -@cli_util.option('--action-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DB_SERVER_FULL_SOFTWARE_UPDATE", "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_OS_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_OS_SOFTWARE_UPDATE"]), help=u"""The type of the scheduled action being performed""") +@cli_util.option('--action-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DB_SERVER_FULL_SOFTWARE_UPDATE", "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_OS_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_OS_SOFTWARE_UPDATE", "DB_SERVER_ONLINE_SOFTWARE_UPDATE"]), help=u"""The type of the scheduled action being performed""") @cli_util.option('--scheduling-plan-id', required=True, help=u"""The [OCID] of the Scheduling Plan.""") @cli_util.option('--scheduling-window-id', required=True, help=u"""The [OCID] of the Scheduling Window.""") @cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment.""") @@ -16684,6 +16708,7 @@ def create_scheduled_action(ctx, from_json, wait_for_state, max_wait_seconds, wa 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('--plan-intent', type=custom_types.CliCaseInsensitiveChoice(["EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE", "EXADATA_INFRASTRUCTURE_SECURITY_UPDATE"]), help=u"""The current intent of the Scheduling Plan. Valid states are EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE and EXADATA_INFRASTRUCTURE_SECURITY_UPDATE.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "NEEDS_ATTENTION", "AVAILABLE", "UPDATING", "FAILED", "DELETING", "DELETED"]), 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 CREATING --wait-for-state DELETED 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.""") @@ -16692,7 +16717,7 @@ def create_scheduled_action(ctx, from_json, wait_for_state, max_wait_seconds, wa @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'SchedulingPlan'}) @cli_util.wrap_exceptions -def create_scheduling_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, scheduling_policy_id, resource_id, service_type, is_using_recommended_scheduled_actions, freeform_tags, defined_tags): +def create_scheduling_plan(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, scheduling_policy_id, resource_id, service_type, is_using_recommended_scheduled_actions, freeform_tags, defined_tags, plan_intent): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -16712,6 +16737,9 @@ def create_scheduling_plan(ctx, from_json, wait_for_state, max_wait_seconds, wai if defined_tags is not None: _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + if plan_intent is not None: + _details['planIntent'] = plan_intent + client = cli_util.build_client('database', 'database', ctx) result = client.create_scheduling_plan( create_scheduling_plan_details=_details, @@ -27500,19 +27528,22 @@ def list_db_servers(ctx, from_json, all_pages, page_size, compartment_id, exadat cli_util.render_response(result, ctx) -@db_system_group.command(name=cli_util.override('db.list_db_system_compute_performances.command_name', 'list-db-system-compute-performances'), help=u"""Gets a list of expected compute performance parameters for a virtual machine DB system based on system configuration. \n[Command Reference](listDbSystemComputePerformances)""") +@db_system_group.command(name=cli_util.override('db.list_db_system_compute_performances.command_name', 'list-db-system-compute-performances'), help=u"""Gets a list of expected compute performance parameters for a virtual machine DB system based on system configuration. Adding compartmentId does not affect results. \n[Command Reference](listDbSystemComputePerformances)""") @cli_util.option('--db-system-shape', help=u"""If provided, filters the results to the set of database versions which are supported for the given shape.""") +@cli_util.option('--compartment-id', help=u"""The compartment [OCID].""") @cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results.""") @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': 'list[DbSystemComputePerformanceSummary]'}) @cli_util.wrap_exceptions -def list_db_system_compute_performances(ctx, from_json, all_pages, db_system_shape): +def list_db_system_compute_performances(ctx, from_json, all_pages, db_system_shape, compartment_id): kwargs = {} if db_system_shape is not None: kwargs['db_system_shape'] = db_system_shape + if compartment_id is not None: + kwargs['compartment_id'] = compartment_id kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) client = cli_util.build_client('database', 'database', ctx) result = client.list_db_system_compute_performances( @@ -29286,7 +29317,8 @@ def list_oneoff_patches(ctx, from_json, all_pages, page_size, compartment_id, li @action_param_values_summary_group.command(name=cli_util.override('db.list_params_for_action_type.command_name', 'list-params-for-action-type'), help=u"""List all the action params and their possible values for a given action type \n[Command Reference](listParamsForActionType)""") -@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DB_SERVER_FULL_SOFTWARE_UPDATE", "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_OS_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_OS_SOFTWARE_UPDATE"]), help=u"""The type of the scheduled action""") +@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DB_SERVER_FULL_SOFTWARE_UPDATE", "STORAGE_SERVER_FULL_SOFTWARE_UPDATE", "NETWORK_SWITCH_FULL_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_OS_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_SOFTWARE_UPDATE", "FSU_VM_CLUSTER_GI_OS_SOFTWARE_UPDATE", "DB_SERVER_ONLINE_SOFTWARE_UPDATE"]), help=u"""The type of the scheduled action""") +@cli_util.option('--plan-intent', type=custom_types.CliCaseInsensitiveChoice(["EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE", "EXADATA_INFRASTRUCTURE_SECURITY_UPDATE"]), help=u"""The plan intent the action will be used for. Relevant to action type that can be used in multiple plans""") @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.""") @@ -29296,12 +29328,14 @@ def list_oneoff_patches(ctx, from_json, all_pages, page_size, compartment_id, li @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database', 'class': 'ActionParamValuesCollection'}) @cli_util.wrap_exceptions -def list_params_for_action_type(ctx, from_json, all_pages, page_size, type, limit, page): +def list_params_for_action_type(ctx, from_json, all_pages, page_size, type, plan_intent, limit, page): if all_pages and limit: raise click.UsageError('If you provide the --all option you cannot provide the --limit option') kwargs = {} + if plan_intent is not None: + kwargs['plan_intent'] = plan_intent if limit is not None: kwargs['limit'] = limit if page is not None: @@ -29525,7 +29559,7 @@ def list_pluggable_databases(ctx, from_json, all_pages, page_size, compartment_i @recommended_scheduled_action_summary_group.command(name=cli_util.override('db.list_recommended_scheduled_actions.command_name', 'list-recommended-scheduled-actions'), help=u"""Returns a recommended Scheduled Actions configuration for a given resource, plan intent and scheduling policy. \n[Command Reference](listRecommendedScheduledActions)""") @cli_util.option('--scheduling-policy-id', required=True, help=u"""The Scheduling Policy [OCID].""") @cli_util.option('--scheduling-policy-target-resource-id', required=True, help=u"""The target resource [OCID] the scheduled actions will be for.""") -@cli_util.option('--plan-intent', required=True, type=custom_types.CliCaseInsensitiveChoice(["EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE"]), help=u"""The scheduling plan intent the scheduled actions will be for.""") +@cli_util.option('--plan-intent', required=True, type=custom_types.CliCaseInsensitiveChoice(["EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE", "EXADATA_INFRASTRUCTURE_SECURITY_UPDATE"]), help=u"""The scheduling plan intent the scheduled actions will be for.""") @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.""") @@ -29712,6 +29746,7 @@ def list_scheduled_actions(ctx, from_json, all_pages, page_size, compartment_id, @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given. The match is not case sensitive.""") @cli_util.option('--resource-id', help=u"""A filter to return only resources that match the given resource id exactly.""") @cli_util.option('--id', help=u"""A filter to return only resources that match the given Schedule Plan id exactly.""") +@cli_util.option('--plan-intent', type=custom_types.CliCaseInsensitiveChoice(["EXADATA_INFRASTRUCTURE_FULL_SOFTWARE_UPDATE", "EXADATA_INFRASTRUCTURE_SECURITY_UPDATE"]), help=u"""A filter to return only resources that match the given plan intent exactly.""") @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({}) @@ -29719,7 +29754,7 @@ def list_scheduled_actions(ctx, from_json, all_pages, page_size, compartment_id, @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database', 'class': 'SchedulingPlanCollection'}) @cli_util.wrap_exceptions -def list_scheduling_plans(ctx, from_json, all_pages, page_size, compartment_id, limit, page, sort_by, sort_order, lifecycle_state, scheduling_policy_id, display_name, resource_id, id): +def list_scheduling_plans(ctx, from_json, all_pages, page_size, compartment_id, limit, page, sort_by, sort_order, lifecycle_state, scheduling_policy_id, display_name, resource_id, id, plan_intent): if all_pages and limit: raise click.UsageError('If you provide the --all option you cannot provide the --limit option') @@ -29743,6 +29778,8 @@ def list_scheduling_plans(ctx, from_json, all_pages, page_size, compartment_id, kwargs['resource_id'] = resource_id if id is not None: kwargs['id'] = id + if plan_intent is not None: + kwargs['plan_intent'] = plan_intent 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: @@ -29778,6 +29815,7 @@ def list_scheduling_plans(ctx, from_json, all_pages, page_size, compartment_id, @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('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "NEEDS_ATTENTION", "AVAILABLE", "UPDATING", "FAILED", "DELETING", "DELETED"]), help=u"""A filter to return only resources that match the given lifecycle state exactly.""") @cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire display name given. The match is not case sensitive.""") +@cli_util.option('--cadence', type=custom_types.CliCaseInsensitiveChoice(["HALFYEARLY", "QUARTERLY", "MONTHLY"]), help=u"""A filter to return only resources that match the given cadence period exactly.""") @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({}) @@ -29785,7 +29823,7 @@ def list_scheduling_plans(ctx, from_json, all_pages, page_size, compartment_id, @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database', 'class': 'list[SchedulingPolicySummary]'}) @cli_util.wrap_exceptions -def list_scheduling_policies(ctx, from_json, all_pages, page_size, compartment_id, limit, page, sort_by, sort_order, lifecycle_state, display_name): +def list_scheduling_policies(ctx, from_json, all_pages, page_size, compartment_id, limit, page, sort_by, sort_order, lifecycle_state, display_name, cadence): if all_pages and limit: raise click.UsageError('If you provide the --all option you cannot provide the --limit option') @@ -29803,6 +29841,8 @@ def list_scheduling_policies(ctx, from_json, all_pages, page_size, compartment_i kwargs['lifecycle_state'] = lifecycle_state if display_name is not None: kwargs['display_name'] = display_name + if cadence is not None: + kwargs['cadence'] = cadence 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: @@ -34394,6 +34434,10 @@ def update_advanced_cluster_file_system(ctx, from_json, force, wait_for_state, m 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('--backup-config', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--db-split-threshold', type=click.INT, help=u"""The CPU value beyond which an Autonomous AI Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs.""") +@cli_util.option('--vm-failover-reservation', type=click.INT, help=u"""The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, 50%, 75%, and 100%, with 50% being the default option.""") +@cli_util.option('--distribution-affinity', type=custom_types.CliCaseInsensitiveChoice(["MINIMUM_DISTRIBUTION", "MAXIMUM_DISTRIBUTION"]), help=u"""Determines whether an Autonomous AI Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected.""") +@cli_util.option('--net-services-architecture', type=custom_types.CliCaseInsensitiveChoice(["DEDICATED", "SHARED", "DRCP"]), help=u"""Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.""") @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(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "BACKUP_IN_PROGRESS", "RESTORING", "RESTORE_FAILED", "RESTARTING", "MAINTENANCE_IN_PROGRESS", "ROLE_CHANGE_IN_PROGRESS", "ENABLING_AUTONOMOUS_DATA_GUARD", "UNAVAILABLE"]), 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 UNAVAILABLE 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.""") @@ -34404,7 +34448,7 @@ def update_advanced_cluster_file_system(ctx, from_json, force, wait_for_state, m @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}, 'maintenance-window-details': {'module': 'database', 'class': 'MaintenanceWindow'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'backup-config': {'module': 'database', 'class': 'AutonomousContainerDatabaseBackupConfig'}}, output_type={'module': 'database', 'class': 'AutonomousContainerDatabase'}) @cli_util.wrap_exceptions -def update_autonomous_container_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_container_database_id, display_name, customer_contacts, okv_end_point_group_name, patch_model, maintenance_window_details, standby_maintenance_buffer_in_days, version_preference, is_dst_file_update_enabled, freeform_tags, defined_tags, backup_config, if_match): +def update_autonomous_container_database(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_container_database_id, display_name, customer_contacts, okv_end_point_group_name, patch_model, maintenance_window_details, standby_maintenance_buffer_in_days, version_preference, is_dst_file_update_enabled, freeform_tags, defined_tags, backup_config, db_split_threshold, vm_failover_reservation, distribution_affinity, net_services_architecture, if_match): if isinstance(autonomous_container_database_id, six.string_types) and len(autonomous_container_database_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-container-database-id cannot be whitespace or empty string') @@ -34452,6 +34496,18 @@ def update_autonomous_container_database(ctx, from_json, force, wait_for_state, if backup_config is not None: _details['backupConfig'] = cli_util.parse_json_parameter("backup_config", backup_config) + if db_split_threshold is not None: + _details['dbSplitThreshold'] = db_split_threshold + + if vm_failover_reservation is not None: + _details['vmFailoverReservation'] = vm_failover_reservation + + if distribution_affinity is not None: + _details['distributionAffinity'] = distribution_affinity + + if net_services_architecture is not None: + _details['netServicesArchitecture'] = net_services_architecture + client = cli_util.build_client('database', 'database', ctx) result = client.update_autonomous_container_database( autonomous_container_database_id=autonomous_container_database_id, @@ -34608,7 +34664,7 @@ def update_autonomous_container_database_dataguard_association(ctx, from_json, w @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. +**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. @@ -34654,7 +34710,9 @@ def update_autonomous_container_database_dataguard_association(ctx, from_json, w 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.""") +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.""") @@ -34714,9 +34772,11 @@ def update_autonomous_container_database_dataguard_association(ctx, from_json, w @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('--encryption-key', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@cli_util.option('--is-disconnect-peer', type=click.BOOL, help=u"""If true, this will disconnect the Autonomous AI Database from its peer and the Autonomous AI Database can work permanently as a standalone database. +@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. -To disconnect a cross region standby, please also provide the OCID of the standby database in the `peerDbId` parameter.""") +**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.""") @@ -35021,7 +35081,7 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s @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. +**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. @@ -35067,7 +35127,9 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s 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.""") +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.""") @@ -35126,9 +35188,11 @@ def update_autonomous_database(ctx, from_json, force, wait_for_state, max_wait_s @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 will disconnect the Autonomous AI Database from its peer and the Autonomous AI Database can work permanently as a standalone database. +@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. -To disconnect a cross region standby, please also provide the OCID of the standby database in the `peerDbId` parameter.""") +**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.""") @@ -35439,7 +35503,7 @@ def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_s @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. +**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. @@ -35485,7 +35549,9 @@ def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_s 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.""") +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.""") @@ -35544,9 +35610,11 @@ def update_autonomous_database_okv_key_details(ctx, from_json, force, wait_for_s @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 will disconnect the Autonomous AI Database from its peer and the Autonomous AI Database can work permanently as a standalone database. +@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, please also provide the OCID of the standby database in the `peerDbId` parameter.""") +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.""") @@ -35851,7 +35919,7 @@ def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for @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. +**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. @@ -35897,7 +35965,9 @@ def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for 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.""") +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.""") @@ -35956,9 +36026,11 @@ def update_autonomous_database_azure_key_details(ctx, from_json, force, wait_for @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 will disconnect the Autonomous AI Database from its peer and the Autonomous AI Database can work permanently as a standalone database. +@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, please also provide the OCID of the standby database in the `peerDbId` parameter.""") +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.""") @@ -36271,7 +36343,7 @@ def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_s @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. +**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. @@ -36317,7 +36389,9 @@ def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_s 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.""") +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.""") @@ -36376,9 +36450,11 @@ def update_autonomous_database_aws_key_details(ctx, from_json, force, wait_for_s @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 will disconnect the Autonomous AI Database from its peer and the Autonomous AI Database can work permanently as a standalone database. +@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, please also provide the OCID of the standby database in the `peerDbId` parameter.""") +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.""") @@ -36685,7 +36761,7 @@ def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_s @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. +**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. @@ -36731,7 +36807,9 @@ def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_s 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.""") +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.""") @@ -36790,9 +36868,11 @@ def update_autonomous_database_oci_key_details(ctx, from_json, force, wait_for_s @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 will disconnect the Autonomous AI Database from its peer and the Autonomous AI Database can work permanently as a standalone database. +@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, please also provide the OCID of the standby database in the `peerDbId` parameter.""") +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.""") @@ -37101,7 +37181,7 @@ def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_s @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. +**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. @@ -37147,7 +37227,9 @@ def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_s 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.""") +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.""") @@ -37206,9 +37288,11 @@ def update_autonomous_database_gcp_key_details(ctx, from_json, force, wait_for_s @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 will disconnect the Autonomous AI Database from its peer and the Autonomous AI Database can work permanently as a standalone database. +@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, please also provide the OCID of the standby database in the `peerDbId` parameter.""") +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.""") @@ -37826,6 +37910,11 @@ def update_autonomous_exadata_infrastructure(ctx, from_json, force, wait_for_sta @cli_util.option('--autonomous-data-storage-size-in-tbs', help=u"""The new value of autonomous data storage (in TBs) for the Autonomous VM cluster.""") @cli_util.option('--cpu-core-count-per-node', type=click.INT, help=u"""The new value of cpus per Autonomous VM cluster per node for the Autonomous VM cluster.""") @cli_util.option('--total-container-databases', type=click.INT, help=u"""The new value of maximum number of ACDs for the Autonomous VM cluster.""") +@cli_util.option('--time-zone', help=u"""The time zone to use for the Autonomous VM cluster. For details, see [DB System Time Zones].""") +@cli_util.option('--scan-listener-port-tls', type=click.INT, help=u"""The SCAN Listener TLS port number. Default value is 2484.""") +@cli_util.option('--scan-listener-port-non-tls', type=click.INT, help=u"""The SCAN Listener Non TLS port number. Default value is 1521.""") +@cli_util.option('--is-mtls-enabled', type=click.BOOL, help=u"""Enable mutual TLS(mTLS) authentication for database. Default is TLS.""") +@cli_util.option('--distribution-algorithm', type=custom_types.CliCaseInsensitiveChoice(["RESOURCE_OPTIMIZED", "DISTRIBUTION_OPTIMIZED"]), help=u"""The distribution algorithm used for the Autonomous VM cluster.""") @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(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "MAINTENANCE_IN_PROGRESS"]), 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 MAINTENANCE_IN_PROGRESS 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.""") @@ -37836,7 +37925,7 @@ def update_autonomous_exadata_infrastructure(ctx, from_json, force, wait_for_sta @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'maintenance-window-details': {'module': 'database', 'class': 'MaintenanceWindow'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'AutonomousVmCluster'}) @cli_util.wrap_exceptions -def update_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_vm_cluster_id, maintenance_window_details, license_model, freeform_tags, defined_tags, autonomous_data_storage_size_in_tbs, cpu_core_count_per_node, total_container_databases, if_match): +def update_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, autonomous_vm_cluster_id, maintenance_window_details, license_model, freeform_tags, defined_tags, autonomous_data_storage_size_in_tbs, cpu_core_count_per_node, total_container_databases, time_zone, scan_listener_port_tls, scan_listener_port_non_tls, is_mtls_enabled, distribution_algorithm, if_match): if isinstance(autonomous_vm_cluster_id, six.string_types) and len(autonomous_vm_cluster_id.strip()) == 0: raise click.UsageError('Parameter --autonomous-vm-cluster-id cannot be whitespace or empty string') @@ -37873,6 +37962,21 @@ def update_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, max_wait if total_container_databases is not None: _details['totalContainerDatabases'] = total_container_databases + if time_zone is not None: + _details['timeZone'] = time_zone + + if scan_listener_port_tls is not None: + _details['scanListenerPortTls'] = scan_listener_port_tls + + if scan_listener_port_non_tls is not None: + _details['scanListenerPortNonTls'] = scan_listener_port_non_tls + + if is_mtls_enabled is not None: + _details['isMtlsEnabled'] = is_mtls_enabled + + if distribution_algorithm is not None: + _details['distributionAlgorithm'] = distribution_algorithm + client = cli_util.build_client('database', 'database', ctx) result = client.update_autonomous_vm_cluster( autonomous_vm_cluster_id=autonomous_vm_cluster_id, @@ -38078,6 +38182,11 @@ def update_backup_destination(ctx, from_json, force, wait_for_state, max_wait_se 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('--cluster-time-zone', help=u"""The time zone to use for the Autonomous VM cluster. For details, see [DB System Time Zones].""") +@cli_util.option('--scan-listener-port-tls', type=click.INT, help=u"""The SCAN Listener TLS port. Default is 2484.""") +@cli_util.option('--scan-listener-port-non-tls', type=click.INT, help=u"""The SCAN Listener Non TLS port. Default is 1521.""") +@cli_util.option('--is-mtls-enabled-vm-cluster', type=click.BOOL, help=u"""Enable mutual TLS(mTLS) authentication for database at time of provisioning a VMCluster. This is applicable to database TLS Certificates only. Default is TLS""") +@cli_util.option('--distribution-algorithm', type=custom_types.CliCaseInsensitiveChoice(["RESOURCE_OPTIMIZED", "DISTRIBUTION_OPTIMIZED"]), help=u"""The distribution algorithm used for the Autonomous VM cluster.""") @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('--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.""") @@ -38090,7 +38199,7 @@ def update_backup_destination(ctx, from_json, force, wait_for_state, max_wait_se @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'maintenance-window-details': {'module': 'database', 'class': 'MaintenanceWindow'}, 'nsg-ids': {'module': 'database', 'class': 'list[string]'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'CloudAutonomousVmCluster'}) @cli_util.wrap_exceptions -def update_cloud_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, cloud_autonomous_vm_cluster_id, description, display_name, maintenance_window_details, autonomous_data_storage_size_in_tbs, cpu_core_count_per_node, total_container_databases, license_model, nsg_ids, freeform_tags, defined_tags, security_attributes, if_match, opc_dry_run): +def update_cloud_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, cloud_autonomous_vm_cluster_id, description, display_name, maintenance_window_details, autonomous_data_storage_size_in_tbs, cpu_core_count_per_node, total_container_databases, license_model, nsg_ids, freeform_tags, defined_tags, cluster_time_zone, scan_listener_port_tls, scan_listener_port_non_tls, is_mtls_enabled_vm_cluster, distribution_algorithm, security_attributes, if_match, opc_dry_run): if isinstance(cloud_autonomous_vm_cluster_id, six.string_types) and len(cloud_autonomous_vm_cluster_id.strip()) == 0: raise click.UsageError('Parameter --cloud-autonomous-vm-cluster-id cannot be whitespace or empty string') @@ -38138,6 +38247,21 @@ def update_cloud_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, ma if defined_tags is not None: _details['definedTags'] = cli_util.parse_json_parameter("defined_tags", defined_tags) + if cluster_time_zone is not None: + _details['clusterTimeZone'] = cluster_time_zone + + if scan_listener_port_tls is not None: + _details['scanListenerPortTls'] = scan_listener_port_tls + + if scan_listener_port_non_tls is not None: + _details['scanListenerPortNonTls'] = scan_listener_port_non_tls + + if is_mtls_enabled_vm_cluster is not None: + _details['isMtlsEnabledVmCluster'] = is_mtls_enabled_vm_cluster + + if distribution_algorithm is not None: + _details['distributionAlgorithm'] = distribution_algorithm + if security_attributes is not None: _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) @@ -38177,6 +38301,7 @@ def update_cloud_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, ma @cli_util.option('--cloud-exadata-infrastructure-id', required=True, help=u"""The cloud Exadata infrastructure [OCID].""") @cli_util.option('--display-name', help=u"""The user-friendly name for the cloud Exadata infrastructure. The name does not need to be unique.""") @cli_util.option('--maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--maintenance-version-preferences', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--compute-count', type=click.INT, help=u"""The number of compute servers for the cloud Exadata infrastructure.""") @cli_util.option('--storage-count', type=click.INT, help=u"""The number of storage servers for the cloud Exadata infrastructure.""") @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]. @@ -38191,18 +38316,18 @@ def update_cloud_autonomous_vm_cluster(ctx, from_json, force, wait_for_state, ma @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["PROVISIONING", "AVAILABLE", "UPDATING", "TERMINATING", "TERMINATED", "FAILED", "MAINTENANCE_IN_PROGRESS"]), 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 MAINTENANCE_IN_PROGRESS 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({'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}) +@json_skeleton_utils.get_cli_json_input_option({'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}, output_type={'module': 'database', 'class': 'CloudExadataInfrastructure'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}, 'customer-contacts': {'module': 'database', 'class': 'list[CustomerContact]'}}, output_type={'module': 'database', 'class': 'CloudExadataInfrastructure'}) @cli_util.wrap_exceptions -def update_cloud_exadata_infrastructure(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, cloud_exadata_infrastructure_id, display_name, maintenance_window, compute_count, storage_count, freeform_tags, defined_tags, customer_contacts, if_match): +def update_cloud_exadata_infrastructure(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, cloud_exadata_infrastructure_id, display_name, maintenance_window, maintenance_version_preferences, compute_count, storage_count, freeform_tags, defined_tags, customer_contacts, if_match): if isinstance(cloud_exadata_infrastructure_id, six.string_types) and len(cloud_exadata_infrastructure_id.strip()) == 0: raise click.UsageError('Parameter --cloud-exadata-infrastructure-id cannot be whitespace or empty string') if not force: - if maintenance_window or freeform_tags or defined_tags or customer_contacts: - if not click.confirm("WARNING: Updates to maintenance-window and freeform-tags and defined-tags and customer-contacts will replace any existing values. Are you sure you want to continue?"): + if maintenance_window or maintenance_version_preferences or freeform_tags or defined_tags or customer_contacts: + if not click.confirm("WARNING: Updates to maintenance-window and maintenance-version-preferences and freeform-tags and defined-tags and customer-contacts will replace any existing values. Are you sure you want to continue?"): ctx.abort() kwargs = {} @@ -38218,6 +38343,9 @@ def update_cloud_exadata_infrastructure(ctx, from_json, force, wait_for_state, m if maintenance_window is not None: _details['maintenanceWindow'] = cli_util.parse_json_parameter("maintenance_window", maintenance_window) + if maintenance_version_preferences is not None: + _details['maintenanceVersionPreferences'] = cli_util.parse_json_parameter("maintenance_version_preferences", maintenance_version_preferences) + if compute_count is not None: _details['computeCount'] = compute_count @@ -39274,6 +39402,7 @@ def update_db_system(ctx, from_json, force, wait_for_state, max_wait_seconds, wa This option is a JSON list with items of type ExadataInfrastructureContact. For documentation on ExadataInfrastructureContact please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/ExadataInfrastructureContact.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--maintenance-version-preferences', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--additional-storage-count', type=click.INT, help=u"""The requested number of additional storage servers for the Exadata infrastructure.""") @cli_util.option('--is-multi-rack-deployment', type=click.BOOL, help=u"""Indicates if deployment is Multi-Rack or not.""") @cli_util.option('--multi-rack-configuration-file', help=u"""The base64 encoded Multi-Rack configuration json file.""") @@ -39293,18 +39422,18 @@ def update_db_system(ctx, from_json, force, wait_for_state, max_wait_seconds, wa @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "REQUIRES_ACTIVATION", "ACTIVATING", "ACTIVE", "ACTIVATION_FAILED", "FAILED", "UPDATING", "DELETING", "DELETED", "DISCONNECTED", "MAINTENANCE_IN_PROGRESS", "WAITING_FOR_CONNECTIVITY"]), 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 CREATING --wait-for-state WAITING_FOR_CONNECTIVITY 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({'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}) +@json_skeleton_utils.get_cli_json_input_option({'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', '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={'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'ExadataInfrastructure'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'contacts': {'module': 'database', 'class': 'list[ExadataInfrastructureContact]'}, 'maintenance-window': {'module': 'database', 'class': 'MaintenanceWindow'}, 'maintenance-version-preferences': {'module': 'database', 'class': 'MaintenanceVersionPreferenceDetails'}, 'dns-server': {'module': 'database', 'class': 'list[string]'}, 'ntp-server': {'module': 'database', 'class': 'list[string]'}, 'network-bonding-mode-details': {'module': 'database', 'class': 'NetworkBondingModeDetails'}, 'freeform-tags': {'module': 'database', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'database', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'database', 'class': 'ExadataInfrastructure'}) @cli_util.wrap_exceptions -def update_exadata_infrastructure(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, exadata_infrastructure_id, cloud_control_plane_server1, cloud_control_plane_server2, netmask, gateway, admin_network_cidr, infini_band_network_cidr, corporate_proxy, contacts, maintenance_window, additional_storage_count, is_multi_rack_deployment, multi_rack_configuration_file, additional_compute_count, additional_compute_system_model, dns_server, ntp_server, time_zone, is_cps_offline_report_enabled, network_bonding_mode_details, freeform_tags, defined_tags, if_match): +def update_exadata_infrastructure(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, exadata_infrastructure_id, cloud_control_plane_server1, cloud_control_plane_server2, netmask, gateway, admin_network_cidr, infini_band_network_cidr, corporate_proxy, contacts, maintenance_window, maintenance_version_preferences, additional_storage_count, is_multi_rack_deployment, multi_rack_configuration_file, additional_compute_count, additional_compute_system_model, dns_server, ntp_server, time_zone, is_cps_offline_report_enabled, network_bonding_mode_details, freeform_tags, defined_tags, if_match): if isinstance(exadata_infrastructure_id, six.string_types) and len(exadata_infrastructure_id.strip()) == 0: raise click.UsageError('Parameter --exadata-infrastructure-id cannot be whitespace or empty string') if not force: - if contacts or maintenance_window or dns_server or ntp_server or network_bonding_mode_details or freeform_tags or defined_tags: - if not click.confirm("WARNING: Updates to contacts and maintenance-window and dns-server and ntp-server and network-bonding-mode-details and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"): + if contacts or maintenance_window or maintenance_version_preferences or dns_server or ntp_server or network_bonding_mode_details or freeform_tags or defined_tags: + if not click.confirm("WARNING: Updates to contacts and maintenance-window and maintenance-version-preferences and dns-server and ntp-server and network-bonding-mode-details and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"): ctx.abort() kwargs = {} @@ -39341,6 +39470,9 @@ def update_exadata_infrastructure(ctx, from_json, force, wait_for_state, max_wai if maintenance_window is not None: _details['maintenanceWindow'] = cli_util.parse_json_parameter("maintenance_window", maintenance_window) + if maintenance_version_preferences is not None: + _details['maintenanceVersionPreferences'] = cli_util.parse_json_parameter("maintenance_version_preferences", maintenance_version_preferences) + if additional_storage_count is not None: _details['additionalStorageCount'] = additional_storage_count diff --git a/services/golden_gate/src/oci_cli_golden_gate/generated/goldengate_cli.py b/services/golden_gate/src/oci_cli_golden_gate/generated/goldengate_cli.py index b8626dbed..81aaa3a3d 100644 --- a/services/golden_gate/src/oci_cli_golden_gate/generated/goldengate_cli.py +++ b/services/golden_gate/src/oci_cli_golden_gate/generated/goldengate_cli.py @@ -1146,6 +1146,180 @@ def change_pipeline_compartment(ctx, from_json, wait_for_state, max_wait_seconds cli_util.render_response(result, ctx) +@pipeline_group.command(name=cli_util.override('goldengate.clone_pipeline.command_name', 'clone'), help=u"""Clones the pipeline. \n[Command Reference](clonePipeline)""") +@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""Type of a pipeline clone. This option applies when cloning a pipeline.""") +@cli_util.option('--display-name', required=True, help=u"""An object's Display Name.""") +@cli_util.option('--source-pipeline-id', required=True, help=u"""The [OCID] of the pipeline. This option applies when retrieving a pipeline.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment being referenced.""") +@cli_util.option('--description', help=u"""Metadata about this specific object.""") +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + +Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Tags defined for this resource. Each key is predefined and scoped to a namespace. + +Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--system-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The system tags associated with this resource, if any. The system tags are set by Oracle Cloud Infrastructure services. Each key is predefined and scoped to namespaces. For more information, see [Resource Tags]. + +Example: `{orcl-cloud: {free-tier-retain: true}}`""" + 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 is updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "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': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'system-tags': {'module': 'golden_gate', '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': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'system-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'golden_gate', 'class': 'Pipeline'}) +@cli_util.wrap_exceptions +def clone_pipeline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, type, display_name, source_pipeline_id, compartment_id, description, freeform_tags, defined_tags, system_tags, if_match, is_lock_override): + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + if is_lock_override is not None: + kwargs['is_lock_override'] = is_lock_override + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['type'] = type + _details['displayName'] = display_name + _details['sourcePipelineId'] = source_pipeline_id + _details['compartmentId'] = compartment_id + + 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) + + if system_tags is not None: + _details['systemTags'] = cli_util.parse_json_parameter("system_tags", system_tags) + + client = cli_util.build_client('golden_gate', 'golden_gate', ctx) + result = client.clone_pipeline( + clone_pipeline_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) + + +@pipeline_group.command(name=cli_util.override('goldengate.clone_pipeline_default_clone_pipeline_details.command_name', 'clone-pipeline-default-clone-pipeline-details'), help=u"""Clones the pipeline. \n[Command Reference](clonePipeline)""") +@cli_util.option('--display-name', required=True, help=u"""An object's Display Name.""") +@cli_util.option('--source-pipeline-id', required=True, help=u"""The [OCID] of the pipeline. This option applies when retrieving a pipeline.""") +@cli_util.option('--compartment-id', required=True, help=u"""The [OCID] of the compartment being referenced.""") +@cli_util.option('--description', help=u"""Metadata about this specific object.""") +@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""A simple key-value pair that is applied without any predefined name, type, or scope. Exists for cross-compatibility only. + +Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Tags defined for this resource. Each key is predefined and scoped to a namespace. + +Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--system-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The system tags associated with this resource, if any. The system tags are set by Oracle Cloud Infrastructure services. Each key is predefined and scoped to namespaces. For more information, see [Resource Tags]. + +Example: `{orcl-cloud: {free-tier-retain: true}}`""" + 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 is updated or deleted only if the etag you provide matches the resource's current etag value.""") +@cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""") +@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "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': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'system-tags': {'module': 'golden_gate', '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': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'system-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'golden_gate', 'class': 'Pipeline'}) +@cli_util.wrap_exceptions +def clone_pipeline_default_clone_pipeline_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, source_pipeline_id, compartment_id, description, freeform_tags, defined_tags, system_tags, if_match, is_lock_override): + + kwargs = {} + if if_match is not None: + kwargs['if_match'] = if_match + if is_lock_override is not None: + kwargs['is_lock_override'] = is_lock_override + kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) + + _details = {} + _details['displayName'] = display_name + _details['sourcePipelineId'] = source_pipeline_id + _details['compartmentId'] = compartment_id + + 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) + + if system_tags is not None: + _details['systemTags'] = cli_util.parse_json_parameter("system_tags", system_tags) + + _details['type'] = 'DEFAULT' + + client = cli_util.build_client('golden_gate', 'golden_gate', ctx) + result = client.clone_pipeline( + clone_pipeline_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) + + @deployment_group.command(name=cli_util.override('goldengate.collect_deployment_diagnostic.command_name', 'collect-deployment-diagnostic'), help=u"""Collects the diagnostic of a Deployment. When provided, If-Match is checked against ETag values of the resource. \n[Command Reference](collectDeploymentDiagnostic)""") @cli_util.option('--deployment-id', required=True, help=u"""A unique Deployment identifier.""") @cli_util.option('--namespace-name', required=True, help=u"""Name of namespace that serves as a container for all of your buckets""") @@ -6142,12 +6316,13 @@ def create_database_registration(ctx, from_json, wait_for_state, max_wait_second @cli_util.option('--is-public', type=click.BOOL, help=u"""True if this object is publicly available.""") @cli_util.option('--cpu-core-count', type=click.INT, help=u"""The Minimum number of OCPUs to be made available for this Deployment.""") @cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Deployment's CPU core count.""") -@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS"]), help=u"""The type of deployment, which can be any one of the Allowed values. NOTE: Use of the value 'OGG' is maintained for backward compatibility purposes. Its use is discouraged in favor of 'DATABASE_ORACLE'.""") +@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS", "VERIDATA_SERVER", "VERIDATA_AGENT"]), help=u"""The type of deployment, which can be any one of the Allowed values. NOTE: Use of the value 'OGG' is maintained for backward compatibility purposes. Its use is discouraged in favor of 'DATABASE_ORACLE'.""") @cli_util.option('--subscription-id', help=u"""The [OCID] of the subscription with which resource needs to be associated with.""") @cli_util.option('--cluster-placement-group-id', help=u"""The OCID(/Content/General/Concepts/identifiers.htm) of the cluster placement group for the resource. Only applicable for multicloud subscriptions. The cluster placement group id must be provided when a multicloud subscription id is provided. Otherwise the cluster placement group must not be provided.""") @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\": \"enforce\"}}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--disaster-recovery-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Indicates if disaster recovery is enabled for a deployment. If not specified, disaster recovery is ENABLED when no clusterPlacementGroupId is provided, and DISABLED when a clusterPlacementGroupId is provided.""") @cli_util.option('--ogg-data', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--maintenance-window', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--maintenance-configuration', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @@ -6160,7 +6335,7 @@ def create_database_registration(ctx, from_json, wait_for_state, max_wait_second @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'placements': {'module': 'golden_gate', 'class': 'list[DeploymentPlacementDetails]'}, 'freeform-tags': {'module': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'locks': {'module': 'golden_gate', 'class': 'list[AddResourceLockDetails]'}, 'nsg-ids': {'module': 'golden_gate', 'class': 'list[string]'}, 'security-attributes': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'ogg-data': {'module': 'golden_gate', 'class': 'CreateOggDeploymentDetails'}, 'maintenance-window': {'module': 'golden_gate', 'class': 'CreateMaintenanceWindowDetails'}, 'maintenance-configuration': {'module': 'golden_gate', 'class': 'CreateMaintenanceConfigurationDetails'}, 'backup-schedule': {'module': 'golden_gate', 'class': 'CreateBackupScheduleDetails'}}, output_type={'module': 'golden_gate', 'class': 'Deployment'}) @cli_util.wrap_exceptions -def create_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, subnet_id, license_model, is_byol_cpu_core_count_limit_enabled, byol_cpu_core_count_limit, environment_type, description, source_deployment_id, availability_domain, fault_domain, placements, freeform_tags, defined_tags, locks, deployment_backup_id, load_balancer_subnet_id, fqdn, nsg_ids, is_public, cpu_core_count, is_auto_scaling_enabled, deployment_type, subscription_id, cluster_placement_group_id, security_attributes, ogg_data, maintenance_window, maintenance_configuration, backup_schedule): +def create_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, subnet_id, license_model, is_byol_cpu_core_count_limit_enabled, byol_cpu_core_count_limit, environment_type, description, source_deployment_id, availability_domain, fault_domain, placements, freeform_tags, defined_tags, locks, deployment_backup_id, load_balancer_subnet_id, fqdn, nsg_ids, is_public, cpu_core_count, is_auto_scaling_enabled, deployment_type, subscription_id, cluster_placement_group_id, security_attributes, disaster_recovery_status, ogg_data, maintenance_window, maintenance_configuration, backup_schedule): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -6239,6 +6414,9 @@ def create_deployment(ctx, from_json, wait_for_state, max_wait_seconds, wait_int if security_attributes is not None: _details['securityAttributes'] = cli_util.parse_json_parameter("security_attributes", security_attributes) + if disaster_recovery_status is not None: + _details['disasterRecoveryStatus'] = disaster_recovery_status + if ogg_data is not None: _details['oggData'] = cli_util.parse_json_parameter("ogg_data", ogg_data) @@ -6389,6 +6567,8 @@ def create_deployment_backup(ctx, from_json, wait_for_state, max_wait_seconds, w This option is a JSON list with items of type ResourceLock. For documentation on ResourceLock please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/goldengate/20200407/datatypes/ResourceLock.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet of the pipeline's private endpoint. The subnet must be a private subnet.""") +@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The Minimum number of OCPUs to be made available for this Deployment.""") +@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Deployment's CPU core count.""") @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "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.""") @@ -6397,7 +6577,7 @@ def create_deployment_backup(ctx, from_json, wait_for_state, max_wait_seconds, w @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'locks': {'module': 'golden_gate', 'class': 'list[ResourceLock]'}, 'source-connection-details': {'module': 'golden_gate', 'class': 'SourcePipelineConnectionDetails'}, 'target-connection-details': {'module': 'golden_gate', 'class': 'TargetPipelineConnectionDetails'}}, output_type={'module': 'golden_gate', 'class': 'Pipeline'}) @cli_util.wrap_exceptions -def create_pipeline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, recipe_type, display_name, compartment_id, license_model, source_connection_details, target_connection_details, description, freeform_tags, defined_tags, locks, subnet_id): +def create_pipeline(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, recipe_type, display_name, compartment_id, license_model, source_connection_details, target_connection_details, description, freeform_tags, defined_tags, locks, subnet_id, cpu_core_count, is_auto_scaling_enabled): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -6425,6 +6605,12 @@ def create_pipeline(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter if subnet_id is not None: _details['subnetId'] = subnet_id + if cpu_core_count is not None: + _details['cpuCoreCount'] = cpu_core_count + + if is_auto_scaling_enabled is not None: + _details['isAutoScalingEnabled'] = is_auto_scaling_enabled + client = cli_util.build_client('golden_gate', 'golden_gate', ctx) result = client.create_pipeline( create_pipeline_details=_details, @@ -6477,6 +6663,8 @@ def create_pipeline(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter This option is a JSON list with items of type ResourceLock. For documentation on ResourceLock please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/goldengate/20200407/datatypes/ResourceLock.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet of the pipeline's private endpoint. The subnet must be a private subnet.""") +@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The Minimum number of OCPUs to be made available for this Deployment.""") +@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Deployment's CPU core count.""") @cli_util.option('--process-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "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.""") @@ -6486,7 +6674,7 @@ def create_pipeline(ctx, from_json, wait_for_state, max_wait_seconds, wait_inter @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'locks': {'module': 'golden_gate', 'class': 'list[ResourceLock]'}, 'source-connection-details': {'module': 'golden_gate', 'class': 'SourcePipelineConnectionDetails'}, 'target-connection-details': {'module': 'golden_gate', 'class': 'TargetPipelineConnectionDetails'}, 'process-options': {'module': 'golden_gate', 'class': 'ProcessOptions'}}, output_type={'module': 'golden_gate', 'class': 'Pipeline'}) @cli_util.wrap_exceptions -def create_pipeline_create_zero_etl_pipeline_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, license_model, source_connection_details, target_connection_details, description, freeform_tags, defined_tags, locks, subnet_id, process_options): +def create_pipeline_create_zero_etl_pipeline_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, display_name, compartment_id, license_model, source_connection_details, target_connection_details, description, freeform_tags, defined_tags, locks, subnet_id, cpu_core_count, is_auto_scaling_enabled, process_options): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -6513,6 +6701,12 @@ def create_pipeline_create_zero_etl_pipeline_details(ctx, from_json, wait_for_st if subnet_id is not None: _details['subnetId'] = subnet_id + if cpu_core_count is not None: + _details['cpuCoreCount'] = cpu_core_count + + if is_auto_scaling_enabled is not None: + _details['isAutoScalingEnabled'] = is_auto_scaling_enabled + if process_options is not None: _details['processOptions'] = cli_util.parse_json_parameter("process_options", process_options) @@ -7103,6 +7297,69 @@ def export_deployment_wallet(ctx, from_json, wait_for_state, max_wait_seconds, w cli_util.render_response(result, ctx) +@deployment_group.command(name=cli_util.override('goldengate.generate_disaster_recovery_precheck_report.command_name', 'generate-disaster-recovery-precheck-report'), help=u"""Generates disaster recovery precheck report for standby peer. \n[Command Reference](generateDisasterRecoveryPrecheckReport)""") +@cli_util.option('--deployment-id', required=True, help=u"""A unique Deployment identifier.""") +@cli_util.option('--availability-domain', required=True, help=u"""The availability domain of a placement.""") +@cli_util.option('--fault-domain', required=True, help=u"""The fault domain of a placement.""") +@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 is 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", "FAILED", "SUCCEEDED", "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 generate_disaster_recovery_precheck_report(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, deployment_id, availability_domain, fault_domain, if_match): + + if isinstance(deployment_id, six.string_types) and len(deployment_id.strip()) == 0: + raise click.UsageError('Parameter --deployment-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['availabilityDomain'] = availability_domain + _details['faultDomain'] = fault_domain + + client = cli_util.build_client('golden_gate', 'golden_gate', ctx) + result = client.generate_disaster_recovery_precheck_report( + deployment_id=deployment_id, + generate_disaster_recovery_precheck_report_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) + + @deployment_group.command(name=cli_util.override('goldengate.generate_library_url.command_name', 'generate-library-url'), help=u"""Generates a Pre-Authenticated Request Object URL to a DB2 for z/OS library that needs to be uploaded to your DB2 for z/OS server in order to establish GoldenGate connections to it. For licensing reasons, the URL is accessible for 10 minutes only. \n[Command Reference](generateLibraryUrl)""") @cli_util.option('--deployment-id', required=True, help=u"""A unique Deployment identifier.""") @cli_util.option('--library-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["LOG_READER_COMPONENT"]), help=u"""The type of the library URL generation.""") @@ -7327,6 +7584,32 @@ def get_deployment_upgrade(ctx, from_json, deployment_upgrade_id): cli_util.render_response(result, ctx) +@deployment_group.command(name=cli_util.override('goldengate.get_disaster_recovery_precheck_report.command_name', 'get-disaster-recovery-precheck-report'), help=u"""Returns DR precheck report for a standby peer with the specified placement (availabilityDomain and faultDomain). \n[Command Reference](getDisasterRecoveryPrecheckReport)""") +@cli_util.option('--deployment-id', required=True, help=u"""A unique Deployment identifier.""") +@cli_util.option('--availability-domain', required=True, help=u"""The availability domain of the placement to evaluate DR pre-checks for.""") +@cli_util.option('--fault-domain', required=True, help=u"""The fault domain of the placement to evaluate DR pre-checks for.""") +@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': 'golden_gate', 'class': 'DisasterRecoveryPrecheckReport'}) +@cli_util.wrap_exceptions +def get_disaster_recovery_precheck_report(ctx, from_json, deployment_id, availability_domain, fault_domain): + + if isinstance(deployment_id, six.string_types) and len(deployment_id.strip()) == 0: + raise click.UsageError('Parameter --deployment-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('golden_gate', 'golden_gate', ctx) + result = client.get_disaster_recovery_precheck_report( + deployment_id=deployment_id, + availability_domain=availability_domain, + fault_domain=fault_domain, + **kwargs + ) + cli_util.render_response(result, ctx) + + @pipeline_group.command(name=cli_util.override('goldengate.get_pipeline.command_name', 'get'), help=u"""Retrieves a Pipeline details. \n[Command Reference](getPipeline)""") @cli_util.option('--pipeline-id', required=True, help=u"""The [OCID] of the pipeline created.""") @json_skeleton_utils.get_cli_json_input_option({}) @@ -7585,7 +7868,7 @@ def list_connection_assignments(ctx, from_json, all_pages, page_size, compartmen @cli_util.option('--connection-type', type=custom_types.CliCaseInsensitiveChoice(["GOLDENGATE", "KAFKA", "KAFKA_SCHEMA_REGISTRY", "MYSQL", "JAVA_MESSAGE_SERVICE", "MICROSOFT_SQLSERVER", "OCI_OBJECT_STORAGE", "ORACLE", "AZURE_DATA_LAKE_STORAGE", "POSTGRESQL", "AZURE_SYNAPSE_ANALYTICS", "SNOWFLAKE", "AMAZON_S3", "HDFS", "ORACLE_AI_DATA_PLATFORM", "ORACLE_NOSQL", "MONGODB", "AMAZON_KINESIS", "AMAZON_REDSHIFT", "DB2", "REDIS", "ELASTICSEARCH", "GENERIC", "GOOGLE_CLOUD_STORAGE", "GOOGLE_BIGQUERY", "DATABRICKS", "GOOGLE_PUBSUB", "MICROSOFT_FABRIC", "ICEBERG"]), multiple=True, help=u"""The array of connection types.""") @cli_util.option('--assigned-deployment-id', help=u"""The OCID of the deployment which for the connection must be assigned.""") @cli_util.option('--assignable-deployment-id', help=u"""Filters for compatible connections which can be, but currently not assigned to the deployment specified by its id.""") -@cli_util.option('--assignable-deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS"]), help=u"""Filters for connections which can be assigned to the latest version of the specified deployment type.""") +@cli_util.option('--assignable-deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS", "VERIDATA_SERVER", "VERIDATA_AGENT"]), help=u"""Filters for connections which can be assigned to the latest version of the specified deployment type.""") @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "DELETING", "DELETED", "FAILED"]), help=u"""A filter to return only connections having the 'lifecycleState' given.""") @cli_util.option('--display-name', help=u"""A filter to return only the resources that match the entire 'displayName' given.""") @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") @@ -7833,7 +8116,7 @@ def list_deployment_environments(ctx, from_json, all_pages, page_size, compartme @deployment_peer_summary_group.command(name=cli_util.override('goldengate.list_deployment_peers.command_name', 'list-deployment-peers'), help=u"""Lists the local and remote peers in a deployment. \n[Command Reference](listDeploymentPeers)""") @cli_util.option('--deployment-id', required=True, help=u"""A unique Deployment identifier.""") -@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING"]), help=u"""A filter to return only the deployment peers having the 'lifecycleState' given.""") +@cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "INACTIVE"]), help=u"""A filter to return only the deployment peers having the 'lifecycleState' given.""") @cli_util.option('--display-name', help=u"""A filter to return only the resources that match the entire 'displayName' given.""") @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""") @@ -7896,7 +8179,7 @@ def list_deployment_peers(ctx, from_json, all_pages, page_size, deployment_id, l @deployment_type_collection_group.command(name=cli_util.override('goldengate.list_deployment_types.command_name', 'list-deployment-types'), help=u"""Returns an array of DeploymentTypeDescriptor \n[Command Reference](listDeploymentTypes)""") @cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the work request. Work requests should be scoped to the same compartment as the resource the work request affects. If the work request concerns multiple resources, and those resources are not in the same compartment, it is up to the service team to pick the primary resource whose compartment should be used.""") -@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS"]), help=u"""The type of deployment, the value determines the exact 'type' of the service executed in the deployment. Default value is DATABASE_ORACLE.""") +@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS", "VERIDATA_SERVER", "VERIDATA_AGENT"]), help=u"""The type of deployment, the value determines the exact 'type' of the service executed in the deployment. Default value is DATABASE_ORACLE.""") @cli_util.option('--ogg-version', help=u"""Allows to query by a specific GoldenGate version.""") @cli_util.option('--display-name', help=u"""A filter to return only the resources that match the entire 'displayName' given.""") @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") @@ -8023,7 +8306,7 @@ def list_deployment_upgrades(ctx, from_json, all_pages, page_size, compartment_i @deployment_version_collection_group.command(name=cli_util.override('goldengate.list_deployment_versions.command_name', 'list-deployment-versions'), help=u"""Returns the list of available deployment versions. \n[Command Reference](listDeploymentVersions)""") @cli_util.option('--compartment-id', required=True, help=u"""The OCID of the compartment that contains the work request. Work requests should be scoped to the same compartment as the resource the work request affects. If the work request concerns multiple resources, and those resources are not in the same compartment, it is up to the service team to pick the primary resource whose compartment should be used.""") @cli_util.option('--deployment-id', help=u"""The [OCID] of the deployment in which to list resources.""") -@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS"]), help=u"""The type of deployment, the value determines the exact 'type' of the service executed in the deployment. Default value is DATABASE_ORACLE.""") +@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS", "VERIDATA_SERVER", "VERIDATA_AGENT"]), help=u"""The type of deployment, the value determines the exact 'type' of the service executed in the deployment. Default value is DATABASE_ORACLE.""") @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") @cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""") @cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""") @@ -8147,7 +8430,7 @@ def list_deployment_wallets_operations(ctx, from_json, all_pages, page_size, dep @cli_util.option('--assignable-connection-id', help=u"""Return the deployments to which the specified connectionId may be assigned.""") @cli_util.option('--lifecycle-state', type=custom_types.CliCaseInsensitiveChoice(["CREATING", "UPDATING", "ACTIVE", "INACTIVE", "DELETING", "DELETED", "FAILED", "NEEDS_ATTENTION"]), help=u"""A filter to return only the deployments having the 'lifecycleState' given.""") @cli_util.option('--lifecycle-sub-state', type=custom_types.CliCaseInsensitiveChoice(["RECOVERING", "STARTING", "STOPPING", "MOVING", "UPGRADING", "RESTORING", "BACKUP_IN_PROGRESS", "ROLLBACK_IN_PROGRESS"]), help=u"""A filter to return only the resources that match the 'lifecycleSubState' given.""") -@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS"]), help=u"""A filter that returns only the resources matching the specified 'deploymentType'.""") +@cli_util.option('--deployment-type', type=custom_types.CliCaseInsensitiveChoice(["OGG", "DATABASE_ORACLE", "BIGDATA", "DATABASE_MICROSOFT_SQLSERVER", "DATABASE_MYSQL", "DATABASE_POSTGRESQL", "DATABASE_DB2ZOS", "DATABASE_DB2I", "GGSA", "DATA_TRANSFORMS", "VERIDATA_SERVER", "VERIDATA_AGENT"]), help=u"""A filter that returns only the resources matching the specified 'deploymentType'.""") @cli_util.option('--display-name', help=u"""A filter to return only the resources that match the entire 'displayName' given.""") @cli_util.option('--fqdn', help=u"""A filter to return only the resources that match the 'fqdn' given.""") @cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""") @@ -10448,6 +10731,7 @@ def stop_pipeline_default_stop_pipeline_details(ctx, from_json, wait_for_state, @cli_util.option('--deployment-id', required=True, help=u"""A unique Deployment identifier.""") @cli_util.option('--availability-domain', required=True, help=u"""The availability domain of a placement.""") @cli_util.option('--fault-domain', required=True, help=u"""The fault domain of a placement.""") +@cli_util.option('--mode', type=custom_types.CliCaseInsensitiveChoice(["SWITCHOVER", "FAILOVER"]), help=u"""Specifies the switchover mode. SWITCHOVER performs a planned role transition to the standby; FAILOVER performs a forced promotion when the primary is not available.""") @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 is 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", "FAILED", "SUCCEEDED", "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.""") @@ -10457,7 +10741,7 @@ def stop_pipeline_default_stop_pipeline_details(ctx, from_json, wait_for_state, @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}) @cli_util.wrap_exceptions -def switchover_deployment_peer(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, deployment_id, availability_domain, fault_domain, if_match): +def switchover_deployment_peer(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, deployment_id, availability_domain, fault_domain, mode, if_match): if isinstance(deployment_id, six.string_types) and len(deployment_id.strip()) == 0: raise click.UsageError('Parameter --deployment-id cannot be whitespace or empty string') @@ -10471,6 +10755,9 @@ def switchover_deployment_peer(ctx, from_json, wait_for_state, max_wait_seconds, _details['availabilityDomain'] = availability_domain _details['faultDomain'] = fault_domain + if mode is not None: + _details['mode'] = mode + client = cli_util.build_client('golden_gate', 'golden_gate', ctx) result = client.switchover_deployment_peer( deployment_id=deployment_id, @@ -15642,6 +15929,8 @@ def update_deployment_backup(ctx, from_json, force, wait_for_state, max_wait_sec Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet of the pipeline's private endpoint. The subnet must be a private subnet.""") +@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The Minimum number of OCPUs to be made available for this Deployment.""") +@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Deployment's CPU core count.""") @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 is updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--is-lock-override', type=click.BOOL, help=u"""Whether to override locks (if any exist).""") @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) @@ -15653,7 +15942,7 @@ def update_deployment_backup(ctx, from_json, force, wait_for_state, max_wait_sec @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}}) @cli_util.wrap_exceptions -def update_pipeline(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, pipeline_id, recipe_type, display_name, description, license_model, freeform_tags, defined_tags, subnet_id, if_match, is_lock_override): +def update_pipeline(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, pipeline_id, recipe_type, display_name, description, license_model, freeform_tags, defined_tags, subnet_id, cpu_core_count, is_auto_scaling_enabled, if_match, is_lock_override): if isinstance(pipeline_id, six.string_types) and len(pipeline_id.strip()) == 0: raise click.UsageError('Parameter --pipeline-id cannot be whitespace or empty string') @@ -15692,6 +15981,12 @@ def update_pipeline(ctx, from_json, force, wait_for_state, max_wait_seconds, wai if subnet_id is not None: _details['subnetId'] = subnet_id + if cpu_core_count is not None: + _details['cpuCoreCount'] = cpu_core_count + + if is_auto_scaling_enabled is not None: + _details['isAutoScalingEnabled'] = is_auto_scaling_enabled + client = cli_util.build_client('golden_gate', 'golden_gate', ctx) result = client.update_pipeline( pipeline_id=pipeline_id, @@ -15740,6 +16035,8 @@ def update_pipeline(ctx, from_json, force, wait_for_state, max_wait_seconds, wai Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--subnet-id', help=u"""The [OCID] of the subnet of the pipeline's private endpoint. The subnet must be a private subnet.""") +@cli_util.option('--cpu-core-count', type=click.INT, help=u"""The Minimum number of OCPUs to be made available for this Deployment.""") +@cli_util.option('--is-auto-scaling-enabled', type=click.BOOL, help=u"""Indicates if auto scaling is enabled for the Deployment's CPU core count.""") @cli_util.option('--process-options', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--mapping-rules', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Mapping for source/target schema/tables for the pipeline data replication. @@ -15755,7 +16052,7 @@ def update_pipeline(ctx, from_json, force, wait_for_state, max_wait_seconds, wai @click.pass_context @json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'golden_gate', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'golden_gate', 'class': 'dict(str, dict(str, object))'}, 'process-options': {'module': 'golden_gate', 'class': 'ProcessOptions'}, 'mapping-rules': {'module': 'golden_gate', 'class': 'list[MappingRule]'}}) @cli_util.wrap_exceptions -def update_pipeline_update_zero_etl_pipeline_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, pipeline_id, display_name, description, license_model, freeform_tags, defined_tags, subnet_id, process_options, mapping_rules, if_match, is_lock_override): +def update_pipeline_update_zero_etl_pipeline_details(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, pipeline_id, display_name, description, license_model, freeform_tags, defined_tags, subnet_id, cpu_core_count, is_auto_scaling_enabled, process_options, mapping_rules, if_match, is_lock_override): if isinstance(pipeline_id, six.string_types) and len(pipeline_id.strip()) == 0: raise click.UsageError('Parameter --pipeline-id cannot be whitespace or empty string') @@ -15791,6 +16088,12 @@ def update_pipeline_update_zero_etl_pipeline_details(ctx, from_json, force, wait if subnet_id is not None: _details['subnetId'] = subnet_id + if cpu_core_count is not None: + _details['cpuCoreCount'] = cpu_core_count + + if is_auto_scaling_enabled is not None: + _details['isAutoScalingEnabled'] = is_auto_scaling_enabled + if process_options is not None: _details['processOptions'] = cli_util.parse_json_parameter("process_options", process_options) diff --git a/services/golden_gate/tests/util/generated/command_to_api.py b/services/golden_gate/tests/util/generated/command_to_api.py index cc9cb7190..0d68aff44 100644 --- a/services/golden_gate/tests/util/generated/command_to_api.py +++ b/services/golden_gate/tests/util/generated/command_to_api.py @@ -16,6 +16,7 @@ "goldengate.change_deployment_compartment": "oci.golden_gate.GoldenGateClient.change_deployment_compartment", "goldengate.change_deployment_subscription": "oci.golden_gate.GoldenGateClient.change_deployment_subscription", "goldengate.change_pipeline_compartment": "oci.golden_gate.GoldenGateClient.change_pipeline_compartment", + "goldengate.clone_pipeline": "oci.golden_gate.GoldenGateClient.clone_pipeline", "goldengate.collect_deployment_diagnostic": "oci.golden_gate.GoldenGateClient.collect_deployment_diagnostic", "goldengate.collect_pipeline_diagnostic": "oci.golden_gate.GoldenGateClient.collect_pipeline_diagnostic", "goldengate.copy_deployment_backup": "oci.golden_gate.GoldenGateClient.copy_deployment_backup", @@ -35,6 +36,7 @@ "goldengate.delete_pipeline": "oci.golden_gate.GoldenGateClient.delete_pipeline", "goldengate.deployment_wallet_exists": "oci.golden_gate.GoldenGateClient.deployment_wallet_exists", "goldengate.export_deployment_wallet": "oci.golden_gate.GoldenGateClient.export_deployment_wallet", + "goldengate.generate_disaster_recovery_precheck_report": "oci.golden_gate.GoldenGateClient.generate_disaster_recovery_precheck_report", "goldengate.generate_library_url": "oci.golden_gate.GoldenGateClient.generate_library_url", "goldengate.get_certificate": "oci.golden_gate.GoldenGateClient.get_certificate", "goldengate.get_connection": "oci.golden_gate.GoldenGateClient.get_connection", @@ -43,6 +45,7 @@ "goldengate.get_deployment": "oci.golden_gate.GoldenGateClient.get_deployment", "goldengate.get_deployment_backup": "oci.golden_gate.GoldenGateClient.get_deployment_backup", "goldengate.get_deployment_upgrade": "oci.golden_gate.GoldenGateClient.get_deployment_upgrade", + "goldengate.get_disaster_recovery_precheck_report": "oci.golden_gate.GoldenGateClient.get_disaster_recovery_precheck_report", "goldengate.get_pipeline": "oci.golden_gate.GoldenGateClient.get_pipeline", "goldengate.get_work_request": "oci.golden_gate.GoldenGateClient.get_work_request", "goldengate.import_deployment_wallet": "oci.golden_gate.GoldenGateClient.import_deployment_wallet", diff --git a/services/network_firewall/src/oci_cli_network_firewall/generated/networkfirewall_cli.py b/services/network_firewall/src/oci_cli_network_firewall/generated/networkfirewall_cli.py index 90cfb80e4..f5e75b63b 100644 --- a/services/network_firewall/src/oci_cli_network_firewall/generated/networkfirewall_cli.py +++ b/services/network_firewall/src/oci_cli_network_firewall/generated/networkfirewall_cli.py @@ -16,7 +16,7 @@ from oci_cli.aliasing import CommandGroupWithAlias -@cli.command(cli_util.override('network_firewall.network_firewall_root_group.command_name', 'network-firewall'), cls=CommandGroupWithAlias, help=cli_util.override('network_firewall.network_firewall_root_group.help', """Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs."""), short_help=cli_util.override('network_firewall.network_firewall_root_group.short_help', """Network Firewall API""")) +@cli.command(cli_util.override('network_firewall.network_firewall_root_group.command_name', 'network-firewall'), cls=CommandGroupWithAlias, help=cli_util.override('network_firewall.network_firewall_root_group.help', """Use the Network Firewall API to create network firewalls and configure policies that regulates network traffic in and across VCNs. For more information, see [Overview of Network Firewall]."""), short_help=cli_util.override('network_firewall.network_firewall_root_group.short_help', """Network Firewall API""")) @cli_util.help_option_group def network_firewall_root_group(): pass @@ -118,6 +118,12 @@ def service_list_group(): pass +@click.command(cli_util.override('network_firewall.network_firewall_health_status_group.command_name', 'network-firewall-health-status'), cls=CommandGroupWithAlias, help="""Response for network firewall health status.""") +@cli_util.help_option_group +def network_firewall_health_status_group(): + pass + + @click.command(cli_util.override('network_firewall.security_rule_group.command_name', 'security-rule'), cls=CommandGroupWithAlias, help="""Security Rule used in the firewall policy rules. Security Rules determine whether to block or allow a session based on traffic attributes, such as the source and destination IP address, protocol/port, and the HTTP(S) target URL.""") @cli_util.help_option_group def security_rule_group(): @@ -140,6 +146,7 @@ def security_rule_group(): network_firewall_root_group.add_command(work_request_error_group) network_firewall_root_group.add_command(nat_rule_group) network_firewall_root_group.add_command(service_list_group) +network_firewall_root_group.add_command(network_firewall_health_status_group) network_firewall_root_group.add_command(security_rule_group) @@ -1290,7 +1297,7 @@ def create_application_create_icmp6_application_details(ctx, from_json, network_ @application_group_group.command(name=cli_util.override('network_firewall.create_application_group.command_name', 'create'), help=u"""Creates a new ApplicationGroup for the Network Firewall Policy. \n[Command Reference](createApplicationGroup)""") @cli_util.option('--network-firewall-policy-id', required=True, help=u"""Unique Network Firewall Policy identifier""") @cli_util.option('--name', required=True, help=u"""Name of the application Group.""") -@cli_util.option('--apps', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of application names.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--apps', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of application names.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--description', help=u"""The description of the application list. This field can be used to add additional info.""") @json_skeleton_utils.get_cli_json_input_option({'apps': {'module': 'network_firewall', 'class': 'list[string]'}}) @cli_util.help_option @@ -1307,7 +1314,9 @@ def create_application_group(ctx, from_json, network_firewall_policy_id, name, a _details = {} _details['name'] = name - _details['apps'] = cli_util.parse_json_parameter("apps", apps) + + if apps is not None: + _details['apps'] = cli_util.parse_json_parameter("apps", apps) if description is not None: _details['description'] = description @@ -1481,13 +1490,14 @@ def create_decryption_profile_create_ssl_forward_proxy_profile_details(ctx, from @cli_util.option('--description', help=u"""The description of the decryption rule. This field can be used to add additional info.""") @cli_util.option('--decryption-profile', help=u"""The name of the decryption profile to use.""") @cli_util.option('--secret', help=u"""The name of a mapped secret. Its `type` must match that of the specified decryption profile.""") +@cli_util.option('--secrets', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of mapped secrets.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--position', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) -@json_skeleton_utils.get_cli_json_input_option({'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}) +@json_skeleton_utils.get_cli_json_input_option({'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'secrets': {'module': 'network_firewall', 'class': 'list[string]'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}, output_type={'module': 'network_firewall', 'class': 'DecryptionRule'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'secrets': {'module': 'network_firewall', 'class': 'list[string]'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}, output_type={'module': 'network_firewall', 'class': 'DecryptionRule'}) @cli_util.wrap_exceptions -def create_decryption_rule(ctx, from_json, network_firewall_policy_id, name, condition, action, description, decryption_profile, secret, position): +def create_decryption_rule(ctx, from_json, network_firewall_policy_id, name, condition, action, description, decryption_profile, secret, secrets, position): if isinstance(network_firewall_policy_id, six.string_types) and len(network_firewall_policy_id.strip()) == 0: raise click.UsageError('Parameter --network-firewall-policy-id cannot be whitespace or empty string') @@ -1509,6 +1519,9 @@ def create_decryption_rule(ctx, from_json, network_firewall_policy_id, name, con if secret is not None: _details['secret'] = secret + if secrets is not None: + _details['secrets'] = cli_util.parse_json_parameter("secrets", secrets) + if position is not None: _details['position'] = cli_util.parse_json_parameter("position", position) @@ -1698,15 +1711,18 @@ def create_nat_rule_create_nat_v4_rule_details(ctx, from_json, network_firewall_ @cli_util.option('--shape', help=u"""The shape of a firewall to determine the bandwidth that the firewall allows.""") @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('--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\": \"enforce\"}}}""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "WAITING", "FAILED", "SUCCEEDED", "NEEDS_ATTENTION", "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({'network-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}}) +@json_skeleton_utils.get_cli_json_input_option({'network-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'network_firewall', '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-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'network_firewall', 'class': 'NetworkFirewall'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'network-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'network_firewall', 'class': 'NetworkFirewall'}) @cli_util.wrap_exceptions -def create_network_firewall(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subnet_id, network_firewall_policy_id, display_name, availability_domain, ipv4_address, ipv6_address, network_security_group_ids, nat_configuration, shape, freeform_tags, defined_tags): +def create_network_firewall(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, compartment_id, subnet_id, network_firewall_policy_id, display_name, availability_domain, ipv4_address, ipv6_address, network_security_group_ids, nat_configuration, shape, freeform_tags, defined_tags, security_attributes): kwargs = {} kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) @@ -1743,6 +1759,9 @@ def create_network_firewall(ctx, from_json, wait_for_state, max_wait_seconds, wa 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) + client = cli_util.build_client('network_firewall', 'network_firewall', ctx) result = client.create_network_firewall( create_network_firewall_details=_details, @@ -2880,6 +2899,28 @@ def get_network_firewall(ctx, from_json, network_firewall_id): cli_util.render_response(result, ctx) +@network_firewall_health_status_group.command(name=cli_util.override('network_firewall.get_network_firewall_health_status.command_name', 'get'), help=u"""Get Overall health status of Network Firewall \n[Command Reference](getNetworkFirewallHealthStatus)""") +@cli_util.option('--network-firewall-id', required=True, help=u"""The [OCID] of the Network Firewall resource.""") +@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': 'network_firewall', 'class': 'NetworkFirewallHealthStatus'}) +@cli_util.wrap_exceptions +def get_network_firewall_health_status(ctx, from_json, network_firewall_id): + + if isinstance(network_firewall_id, six.string_types) and len(network_firewall_id.strip()) == 0: + raise click.UsageError('Parameter --network-firewall-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('network_firewall', 'network_firewall', ctx) + result = client.get_network_firewall_health_status( + network_firewall_id=network_firewall_id, + **kwargs + ) + cli_util.render_response(result, ctx) + + @network_firewall_policy_group.command(name=cli_util.override('network_firewall.get_network_firewall_policy.command_name', 'get'), help=u"""Gets a NetworkFirewallPolicy given the network firewall policy identifier. \n[Command Reference](getNetworkFirewallPolicy)""") @cli_util.option('--network-firewall-policy-id', required=True, help=u"""Unique Network Firewall Policy identifier""") @json_skeleton_utils.get_cli_json_input_option({}) @@ -4432,7 +4473,7 @@ def update_application_update_icmp_application_details(ctx, from_json, network_f @application_group_group.command(name=cli_util.override('network_firewall.update_application_group.command_name', 'update'), help=u"""Updates the ApplicationGroup with the given name in the network firewall policy. \n[Command Reference](updateApplicationGroup)""") @cli_util.option('--network-firewall-policy-id', required=True, help=u"""Unique Network Firewall Policy identifier""") @cli_util.option('--application-group-name', required=True, help=u"""Unique name identifier for Application Lists in the scope of Network Firewall Policy.""") -@cli_util.option('--apps', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of application names.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) +@cli_util.option('--apps', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of application names.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--description', help=u"""The description of the application list. This field can be used to add additional info.""") @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) @@ -4459,7 +4500,9 @@ def update_application_group(ctx, from_json, force, network_firewall_policy_id, kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id']) _details = {} - _details['apps'] = cli_util.parse_json_parameter("apps", apps) + + if apps is not None: + _details['apps'] = cli_util.parse_json_parameter("apps", apps) if description is not None: _details['description'] = description @@ -4652,15 +4695,16 @@ def update_decryption_profile_update_ssl_forward_proxy_profile_details(ctx, from @cli_util.option('--description', help=u"""The description of the decryption rule. This field can be used to add additional info.""") @cli_util.option('--decryption-profile', help=u"""The name of the decryption profile to use.""") @cli_util.option('--secret', help=u"""The name of a mapped secret. Its `type` must match that of the specified decryption profile.""") +@cli_util.option('--secrets', type=custom_types.CLI_COMPLEX_TYPE, help=u"""An array of mapped secrets.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--position', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP) @cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""") @cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True) -@json_skeleton_utils.get_cli_json_input_option({'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}) +@json_skeleton_utils.get_cli_json_input_option({'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'secrets': {'module': 'network_firewall', 'class': 'list[string]'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}) @cli_util.help_option @click.pass_context -@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}, output_type={'module': 'network_firewall', 'class': 'DecryptionRule'}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'condition': {'module': 'network_firewall', 'class': 'DecryptionRuleMatchCriteria'}, 'secrets': {'module': 'network_firewall', 'class': 'list[string]'}, 'position': {'module': 'network_firewall', 'class': 'RulePosition'}}, output_type={'module': 'network_firewall', 'class': 'DecryptionRule'}) @cli_util.wrap_exceptions -def update_decryption_rule(ctx, from_json, force, network_firewall_policy_id, decryption_rule_name, condition, action, description, decryption_profile, secret, position, if_match): +def update_decryption_rule(ctx, from_json, force, network_firewall_policy_id, decryption_rule_name, condition, action, description, decryption_profile, secret, secrets, position, if_match): if isinstance(network_firewall_policy_id, six.string_types) and len(network_firewall_policy_id.strip()) == 0: raise click.UsageError('Parameter --network-firewall-policy-id cannot be whitespace or empty string') @@ -4668,8 +4712,8 @@ def update_decryption_rule(ctx, from_json, force, network_firewall_policy_id, de if isinstance(decryption_rule_name, six.string_types) and len(decryption_rule_name.strip()) == 0: raise click.UsageError('Parameter --decryption-rule-name cannot be whitespace or empty string') if not force: - if condition or position: - if not click.confirm("WARNING: Updates to condition and position will replace any existing values. Are you sure you want to continue?"): + if condition or secrets or position: + if not click.confirm("WARNING: Updates to condition and secrets and position will replace any existing values. Are you sure you want to continue?"): ctx.abort() kwargs = {} @@ -4690,6 +4734,9 @@ def update_decryption_rule(ctx, from_json, force, network_firewall_policy_id, de if secret is not None: _details['secret'] = secret + if secrets is not None: + _details['secrets'] = cli_util.parse_json_parameter("secrets", secrets) + if position is not None: _details['position'] = cli_util.parse_json_parameter("position", position) @@ -4910,23 +4957,26 @@ def update_nat_rule_update_nat_v4_rule_details(ctx, from_json, force, network_fi @cli_util.option('--shape', help=u"""The shape of a firewall to determine the bandwidth that the firewall allows.""") @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('--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\": \"enforce\"}}}""" + 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", "FAILED", "SUCCEEDED", "NEEDS_ATTENTION", "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({'network-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}}) +@json_skeleton_utils.get_cli_json_input_option({'network-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'network_firewall', '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-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}}) +@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'network-security-group-ids': {'module': 'network_firewall', 'class': 'list[string]'}, 'nat-configuration': {'module': 'network_firewall', 'class': 'NatConfigurationRequest'}, 'freeform-tags': {'module': 'network_firewall', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}, 'security-attributes': {'module': 'network_firewall', 'class': 'dict(str, dict(str, object))'}}) @cli_util.wrap_exceptions -def update_network_firewall(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, network_firewall_id, display_name, network_firewall_policy_id, network_security_group_ids, nat_configuration, shape, freeform_tags, defined_tags, if_match): +def update_network_firewall(ctx, from_json, force, wait_for_state, max_wait_seconds, wait_interval_seconds, network_firewall_id, display_name, network_firewall_policy_id, network_security_group_ids, nat_configuration, shape, freeform_tags, defined_tags, security_attributes, if_match): if isinstance(network_firewall_id, six.string_types) and len(network_firewall_id.strip()) == 0: raise click.UsageError('Parameter --network-firewall-id cannot be whitespace or empty string') if not force: - if network_security_group_ids or nat_configuration or freeform_tags or defined_tags: - if not click.confirm("WARNING: Updates to network-security-group-ids and nat-configuration and freeform-tags and defined-tags will replace any existing values. Are you sure you want to continue?"): + if network_security_group_ids or nat_configuration or freeform_tags or defined_tags or security_attributes: + if not click.confirm("WARNING: Updates to network-security-group-ids and nat-configuration and freeform-tags and defined-tags and security-attributes will replace any existing values. Are you sure you want to continue?"): ctx.abort() kwargs = {} @@ -4957,6 +5007,9 @@ def update_network_firewall(ctx, from_json, force, wait_for_state, max_wait_seco 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) + client = cli_util.build_client('network_firewall', 'network_firewall', ctx) result = client.update_network_firewall( network_firewall_id=network_firewall_id, diff --git a/services/network_firewall/tests/util/generated/command_to_api.py b/services/network_firewall/tests/util/generated/command_to_api.py index 85cc60f53..525bd2007 100644 --- a/services/network_firewall/tests/util/generated/command_to_api.py +++ b/services/network_firewall/tests/util/generated/command_to_api.py @@ -55,6 +55,7 @@ "network_firewall.get_mapped_secret": "oci.network_firewall.NetworkFirewallClient.get_mapped_secret", "network_firewall.get_nat_rule": "oci.network_firewall.NetworkFirewallClient.get_nat_rule", "network_firewall.get_network_firewall": "oci.network_firewall.NetworkFirewallClient.get_network_firewall", + "network_firewall.get_network_firewall_health_status": "oci.network_firewall.NetworkFirewallClient.get_network_firewall_health_status", "network_firewall.get_network_firewall_policy": "oci.network_firewall.NetworkFirewallClient.get_network_firewall_policy", "network_firewall.get_security_rule": "oci.network_firewall.NetworkFirewallClient.get_security_rule", "network_firewall.get_service": "oci.network_firewall.NetworkFirewallClient.get_service", diff --git a/setup.py b/setup.py index d274b2149..87224a4a7 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def open_relative(*path): readme = f.read() requires = [ - 'oci==2.175.0', + 'oci==2.176.0', 'arrow>=1.0.0,<2.0.0', 'certifi>=2025.1.31,<2026.0.0', 'click<=8.1.2', diff --git a/src/oci_cli/cli_util.py b/src/oci_cli/cli_util.py index 689dd1c0a..a2e67e266 100644 --- a/src/oci_cli/cli_util.py +++ b/src/oci_cli/cli_util.py @@ -2094,6 +2094,7 @@ def list_call_get_all_results(list_func_ref, ctx=None, is_json=False, stream_out aggregated_results = [] aggregated_results_dict = {} wrapped_array_pagination = False + final_response = None page_index = 1 has_stream_data = False @@ -2153,7 +2154,8 @@ def list_call_get_all_results(list_func_ref, ctx=None, is_json=False, stream_out headers = call_result.headers request = call_result.request final_response = Response(status, headers, post_processed_results, request) - return final_response + if final_response is not None: + return final_response if ctx and ctx.obj['debug']: print("", file=sys.stderr) @@ -2273,6 +2275,7 @@ def list_call_get_all_results_multiple_keys(list_func_ref, ctx=None, is_json=Fal aggregated_results = [] aggregated_results_dict = {} wrapped_array_pagination = False + final_response = None page_index = 1 has_stream_data = False @@ -2337,7 +2340,8 @@ def list_call_get_all_results_multiple_keys(list_func_ref, ctx=None, is_json=Fal headers = call_result.headers request = call_result.request final_response = Response(status, headers, post_processed_results, request) - return final_response + if final_response is not None: + return final_response if ctx and ctx.obj['debug']: print("", file=sys.stderr) diff --git a/src/oci_cli/service_mapping.py b/src/oci_cli/service_mapping.py index 63ac9e7a3..f6edae4dd 100644 --- a/src/oci_cli/service_mapping.py +++ b/src/oci_cli/service_mapping.py @@ -574,7 +574,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 e716be966..d96d1c43a 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.83.0' +__version__ = '3.84.0' diff --git a/tests/resources/json_ignore_command_list.txt b/tests/resources/json_ignore_command_list.txt index 0ad49c651..9aab18261 100644 --- a/tests/resources/json_ignore_command_list.txt +++ b/tests/resources/json_ignore_command_list.txt @@ -608,3 +608,4 @@ database-tools-runtime, database-tools-database-api-gateway-config-pool-auto-api dbtools-runtime, connection, execute-sql, async dbtools-runtime, database-api-gateway-config-pool-auto-api-spec, create, default dbtools-runtime, database-api-gateway-config-pool-auto-api-spec, update, default +db, cloud-exa-infra, update \ No newline at end of file diff --git a/tests/unit/test_cli_util.py b/tests/unit/test_cli_util.py index d71af881e..0169923bc 100644 --- a/tests/unit/test_cli_util.py +++ b/tests/unit/test_cli_util.py @@ -6,6 +6,7 @@ import oci import tempfile import unittest +import unittest.mock as mock from oci_cli import cli_util @@ -32,6 +33,25 @@ def build_config(ctx): class TestCliUtil(unittest.TestCase): + @staticmethod + def _build_ctx(): + ctx = Obj() + ctx.obj = Obj() + ctx.obj['query'] = None + ctx.obj['debug'] = False + return ctx + + @staticmethod + def _build_paginated_response(data, has_next_page=False, next_page=None): + response = Obj() + response.status = 200 + response.headers = {'opc-request-id': 'test'} + response.data = data + response.request = 'request' + response.has_next_page = has_next_page + response.next_page = next_page + return response + def test_iam_coalesce_provided_and_default_value(self): ctx = Obj() ctx.obj = Obj() @@ -142,3 +162,67 @@ def test_get_possible_subtype_based_on_payload(self): subtype = cli_util.get_possible_subtype_based_on_payload(oci.core.models.InstanceConfigurationInstanceDetails, 'core', payload) assert subtype.__class__.__name__ == 'ComputeInstanceDetails' + + def test_list_call_get_all_results_stream_output_returns_response(self): + ctx = self._build_ctx() + + with mock.patch('oci_cli.cli_util.stream_header') as mock_stream_header: + with mock.patch('oci_cli.cli_util.stream_page', return_value=True) as mock_stream_page: + with mock.patch('oci_cli.cli_util.stream_footer') as mock_stream_footer: + response = cli_util.list_call_get_all_results( + lambda **kwargs: self._build_paginated_response(['item']), + ctx=ctx, + stream_output=True + ) + + assert response.status == 200 + assert response.headers == {'opc-request-id': 'test'} + assert response.data == [] + assert response.request == 'request' + mock_stream_header.assert_called_once() + mock_stream_page.assert_called_once() + mock_stream_footer.assert_called_once() + + def test_list_call_get_all_results_stream_output_does_not_swallow_exceptions(self): + ctx = self._build_ctx() + + with mock.patch('oci_cli.cli_util.stream_header'): + with mock.patch('oci_cli.cli_util.stream_footer'): + with self.assertRaises(RuntimeError): + cli_util.list_call_get_all_results( + lambda **kwargs: (_ for _ in ()).throw(RuntimeError('boom')), + ctx=ctx, + stream_output=True + ) + + def test_list_call_get_all_results_multiple_keys_stream_output_returns_response(self): + ctx = self._build_ctx() + + with mock.patch('oci_cli.cli_util.stream_header') as mock_stream_header: + with mock.patch('oci_cli.cli_util.stream_page', return_value=True) as mock_stream_page: + with mock.patch('oci_cli.cli_util.stream_footer') as mock_stream_footer: + response = cli_util.list_call_get_all_results_multiple_keys( + lambda **kwargs: self._build_paginated_response(['item']), + ctx=ctx, + stream_output=True + ) + + assert response.status == 200 + assert response.headers == {'opc-request-id': 'test'} + assert response.data == [] + assert response.request == 'request' + mock_stream_header.assert_called_once() + mock_stream_page.assert_called_once() + mock_stream_footer.assert_called_once() + + def test_list_call_get_all_results_multiple_keys_stream_output_does_not_swallow_exceptions(self): + ctx = self._build_ctx() + + with mock.patch('oci_cli.cli_util.stream_header'): + with mock.patch('oci_cli.cli_util.stream_footer'): + with self.assertRaises(RuntimeError): + cli_util.list_call_get_all_results_multiple_keys( + lambda **kwargs: (_ for _ in ()).throw(RuntimeError('boom')), + ctx=ctx, + stream_output=True + )